from sqlalchemy import CHAR, Column, Enum, Float, Index, String, Table, Text, VARBINARY, text, ForeignKey
from sqlalchemy.dialects.mysql import DECIMAL, ENUM, INTEGER, LONGTEXT, MEDIUMTEXT, SMALLINT, TEXT, TINYINT, \
    VARCHAR
from sqlalchemy.orm import declarative_base, relationship

Base = declarative_base()
metadata = Base.metadata


class XlxAd(Base):
    __tablename__ = 'xlx_ad'

    id = Column(INTEGER(10), primary_key=True)
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    cid = Column(INTEGER(10), nullable=False)
    title = Column(String(100), nullable=False)
    imageid = Column(INTEGER(10), nullable=False)
    imageurl = Column(String(255), nullable=False)
    explain = Column(String(255), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    starttime = Column(INTEGER(10), nullable=False)
    deadline = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    target = Column(TINYINT(1), nullable=False)
    link_url = Column(String(255), nullable=False)
    inner_link = Column(String(30), nullable=False)
    inner_link_params = Column(INTEGER(10), nullable=False)
    company_id = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxAdCategory(Base):
    __tablename__ = 'xlx_ad_category'

    id = Column(INTEGER(10), primary_key=True)
    alias = Column(String(50), nullable=False)
    name = Column(String(100), nullable=False)
    width = Column(INTEGER(10), nullable=False)
    height = Column(INTEGER(10), nullable=False)
    ad_num = Column(INTEGER(10), nullable=False)
    is_sys = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    platform = Column(String(30), nullable=False)


class XlxAdmin(Base):
    __tablename__ = 'xlx_admin'

    id = Column(INTEGER(10), primary_key=True)
    username = Column(String(15), nullable=False)
    password = Column(String(32), nullable=False)
    pwd_hash = Column(String(10), nullable=False)
    role_id = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    last_login_time = Column(INTEGER(10), nullable=False)
    last_login_ip = Column(String(30), nullable=False)
    last_login_ipaddress = Column(String(30), nullable=False)
    openid = Column(String(50), nullable=False, server_default=text("''"))
    is_sc = Column(TINYINT(3), nullable=False, server_default=text("'0'"), comment='是否是销售')
    mobile = Column(CHAR(11), nullable=False, server_default=text("''"))
    status = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='状态[1:正常;2:锁定]')
    customer_exceed = Column(TINYINT(1), nullable=False, server_default=text("'0'"),
                             comment='销售客户总数上限[0:未达上限;1:已达上限]')
    avatar = Column(String(200), server_default=text("''"))


t_xlx_admin_identity_token = Table('xlx_admin_identity_token',
                                   metadata,
                                   Column('admin_id', INTEGER(11), nullable=False, server_default=text("'0'"),
                                          comment='管理员ID'),
                                   Column('token', CHAR(32), nullable=False, server_default=text("''"),
                                          comment='token'),
                                   Column('updatetime', INTEGER(10), nullable=False, server_default=text("'0'"),
                                          comment='更新时间'),
                                   Column('expire', INTEGER(10), nullable=False, server_default=text("'0'"),
                                          comment='过期时间'),
                                   Index('idx_admin_id', 'admin_id'),
                                   comment='后台管理员token表')


class XlxAdminLog(Base):
    __tablename__ = 'xlx_admin_log'
    __table_args__ = (Index('idx_type', 'type'), Index('index_fulltext_index', 'content'))

    id = Column(INTEGER(10), primary_key=True)
    admin_id = Column(INTEGER(10), nullable=False)
    admin_name = Column(String(30), nullable=False)
    content = Column(Text, nullable=False)
    is_login = Column(TINYINT(1), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    ip = Column(String(30), nullable=False)
    ip_addr = Column(String(30), nullable=False)
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"),
                  comment='操作类型[0:-;1:常规;2:新增;3:修改;4:删除;5:业务;6:审核;7:锁定;8:导出]')


class XlxAdminRole(Base):
    __tablename__ = 'xlx_admin_role'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(15), nullable=False)
    access = Column(Text, nullable=False)
    access_mobile = Column(Text, nullable=False)
    access_export = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    access_delete = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    access_set_service = Column(TINYINT(1), nullable=False, server_default=text("'0'"))


class XlxAdminScanCert(Base):
    __tablename__ = 'xlx_admin_scan_cert'
    __table_args__ = (Index('index_token', 'token'),)

    id = Column(INTEGER(10), primary_key=True)
    token = Column(String(32), nullable=False)
    info = Column(Text, nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxAliAxb(Base):
    __tablename__ = 'xlx_ali_axb'

    id = Column(INTEGER(11), primary_key=True)
    a = Column(String(15), nullable=False)
    b = Column(String(15), nullable=False)
    x = Column(String(15), nullable=False, server_default=text("''"))
    sub_id = Column(String(20), nullable=False, server_default=text("''"))
    addtime = Column(INTEGER(11), nullable=False, server_default=text("'0'"))


class XlxArticle(Base):
    __tablename__ = 'xlx_article'
    __table_args__ = (
        Index('index_addtime', 'addtime'), Index('index_cid_sort_id', 'cid', 'sort_id'), Index('index_click', 'click'))

    id = Column(INTEGER(10), primary_key=True)
    cid = Column(INTEGER(10), nullable=False)
    title = Column(String(100), nullable=False)
    content = Column(LONGTEXT, nullable=False)
    attach = Column(Text, nullable=False)
    thumb = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    link_url = Column(String(200), nullable=False, server_default=text("''"))
    seo_keywords = Column(String(100), nullable=False, server_default=text("''"))
    seo_description = Column(String(200), nullable=False, server_default=text("''"))
    click = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    addtime = Column(INTEGER(10), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    source = Column(TINYINT(1), nullable=False)
    source_reprint = Column(String(50), nullable=False, server_default=text("''"), comment='转载来源')


class XlxArticleCategory(Base):
    __tablename__ = 'xlx_article_category'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(10), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    seo_title = Column(String(100), nullable=False, server_default=text("''"), comment='seo标题')
    seo_description = Column(String(200), nullable=False, server_default=text("''"))
    seo_keywords = Column(String(100), nullable=False, server_default=text("''"))
    is_sys = Column(TINYINT(1), nullable=False, server_default=text("'1'"))


class XlxAttentionCompany(Base):
    __tablename__ = 'xlx_attention_company'
    __table_args__ = (Index('index_company_uid', 'company_uid'), Index('index_personal_uid', 'personal_uid'))

    id = Column(INTEGER(10), primary_key=True)
    company_uid = Column(INTEGER(10), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)
    comid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxAuditTemplate(Base):
    __tablename__ = 'xlx_audit_template'
    __table_args__ = (Index('idx_type', 'type'), {'comment': '审核模板表'})

    id = Column(INTEGER(10), primary_key=True)
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='类型：1|简历,2|企业认证,3|职位')
    content = Column(String(100, 'utf8mb4_general_ci'), nullable=False, server_default=text("''"), comment='内容')
    add_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='添加人ID')
    add_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='添加时间')
    is_del = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='是否删除：0|否')


class XlxBadword(Base):
    __tablename__ = 'xlx_badword'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    replace_text = Column(String(30), nullable=False)


class XlxCategory(Base):
    __tablename__ = 'xlx_category'
    __table_args__ = (Index('index_c_alias', 'alias'),)

    id = Column(INTEGER(10), primary_key=True)
    alias = Column(String(30), nullable=False)
    name = Column(String(30), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class XlxCategoryDistrict(Base):
    __tablename__ = 'xlx_category_district'

    id = Column(INTEGER(10), primary_key=True)
    pid = Column(INTEGER(10), nullable=False)
    name = Column(String(30), nullable=False)
    spell = Column(String(50), nullable=False)
    alias = Column(String(10), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    level = Column(TINYINT(1), nullable=False)


class XlxCategoryGroup(Base):
    __tablename__ = 'xlx_category_group'

    id = Column(INTEGER(10), primary_key=True)
    alias = Column(String(30), nullable=False)
    name = Column(String(30), nullable=False)
    is_sys = Column(TINYINT(1), nullable=False, server_default=text("'0'"))


class XlxCategoryJob(Base):
    __tablename__ = 'xlx_category_job'
    __table_args__ = (Index('index_parentid', 'pid'),)

    id = Column(INTEGER(10), primary_key=True)
    pid = Column(INTEGER(10), nullable=False)
    name = Column(String(80), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    content = Column(Text, nullable=False)
    spell = Column(String(200), nullable=False)
    level = Column(TINYINT(1), nullable=False)


class XlxCategoryJobTemplate(Base):
    __tablename__ = 'xlx_category_job_template'
    __table_args__ = (Index('pid', 'pid'), {'comment': '职位分类描述模板表'})

    id = Column(INTEGER(10), primary_key=True, comment='id')
    pid = Column(INTEGER(10), nullable=False, comment='pid')
    title = Column(String(30), nullable=False, comment='标题')
    content = Column(Text, nullable=False, comment='内容')


class XlxCategoryMajor(Base):
    __tablename__ = 'xlx_category_major'

    id = Column(INTEGER(10), primary_key=True)
    pid = Column(INTEGER(10), nullable=False)
    name = Column(String(50), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    level = Column(TINYINT(1), nullable=False)


class XlxCollectionSeting(Base):
    __tablename__ = 'xlx_collection_seting'
    __table_args__ = {'comment': '采集设置'}

    id = Column(INTEGER(10), primary_key=True)
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='采集状态:0|关闭,1|开启')
    matching_accuracy = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='匹配精准度')
    job_seting = Column(String(500), nullable=False, server_default=text("''"), comment='职位设置')
    company_seting = Column(String(500), nullable=False, server_default=text("''"), comment='企业设置')
    account_seting = Column(String(255), nullable=False, server_default=text("''"), comment='账号设置')
    article_seting = Column(String(255), nullable=False, server_default=text("''"), comment='资讯设置')


class XlxCompany(Base):
    __tablename__ = 'xlx_company'
    __table_args__ = (Index('index_uid', 'uid', unique=True),)

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), ForeignKey('xlx_member.uid'), nullable=False)
    companyname = Column(String(60), nullable=False)
    short_name = Column(String(60), nullable=False)
    nature = Column(INTEGER(10), nullable=False)
    trade = Column(INTEGER(10), nullable=False)
    district1 = Column(INTEGER(10), nullable=False)
    district2 = Column(INTEGER(10), nullable=False)
    district3 = Column(INTEGER(10), nullable=False)
    district = Column(INTEGER(10), nullable=False)
    scale = Column(INTEGER(10), nullable=False)
    registered = Column(String(15), nullable=False)
    currency = Column(TINYINT(1), nullable=False)
    tag = Column(String(100), nullable=False)
    map_lat = Column(DECIMAL(9, 6), nullable=False)
    map_lng = Column(DECIMAL(9, 6), nullable=False)
    map_zoom = Column(TINYINT(1), nullable=False)
    audit = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    logo = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    refreshtime = Column(INTEGER(10), nullable=False)
    updatetime = Column(INTEGER(10), nullable=False, comment='更新时间')
    click = Column(INTEGER(10), nullable=False, server_default=text("'1'"))
    robot = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    user_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    cs_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    platform = Column(String(30), nullable=False, server_default=text("''"))
    setmeal_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    life_cycle_id = Column(INTEGER(10), nullable=False, server_default=text("'1'"), comment='CRM客户等级（生命周期）')
    admin_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='所属销售')
    last_visit_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后跟进时间')
    last_visit_admin = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后跟进人')
    labels = Column(String(30), nullable=False, server_default=text("''"), comment='客户标签')
    remark = Column(String(100), nullable=False, server_default=text("''"), comment='备注')
    clue_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='线索id')
    collection_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='领取时间')
    member = relationship("XlxMember", back_populates="company")


class XlxCompanyAuth(Base):
    __tablename__ = 'xlx_company_auth'
    __table_args__ = (Index('index_comid_uid', 'comid', 'uid', unique=True), Index('index_uid', 'uid', unique=True))

    id = Column(INTEGER(10), primary_key=True)
    comid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    legal_person_idcard_front = Column(INTEGER(10), nullable=False)
    legal_person_idcard_back = Column(INTEGER(10), nullable=False)
    license = Column(INTEGER(10), nullable=False)
    proxy = Column(INTEGER(10), nullable=False)


class XlxCompanyAuthLog(Base):
    __tablename__ = 'xlx_company_auth_log'
    __table_args__ = (Index('index_comid_uid', 'comid', 'uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    comid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    audit = Column(TINYINT(1), nullable=False)
    reason = Column(String(200), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxCompanyCancelApplyBackups(Base):
    __tablename__ = 'xlx_company_cancel_apply_backups'
    __table_args__ = {'comment': '企业注销备份'}

    id = Column(INTEGER(10), primary_key=True)
    cancel_apply_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='注销申请id')
    cid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='company_id')
    uid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='uid')
    mobile = Column(CHAR(11, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='会员联系方式')
    companyname = Column(String(60, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"),
                         comment='企业名称')
    contact = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='企业联系人')
    contact_mobile = Column(CHAR(11, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"),
                            comment='企业联系人电话')
    addtime = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='企业添加时间')
    reg_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='注册时间')
    setmeal_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='套餐ID')
    setmeal_name = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"),
                          comment='套餐名称')
    jobs_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='在招职位')
    job_apply_count = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='收到简历')
    download_resume_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='下载简历数')
    cancel_apply_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='注销申请时间')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='添加时间')
    content = Column(Text(collation='utf8mb4_unicode_ci'), comment='备份内容')


class XlxCompanyContact(Base):
    __tablename__ = 'xlx_company_contact'
    __table_args__ = (Index('index_comid_uid', 'comid', 'uid', unique=True), Index('index_uid', 'uid', unique=True))

    id = Column(INTEGER(10), primary_key=True)
    comid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    contact = Column(String(30), nullable=False)
    mobile = Column(String(11), nullable=False)
    weixin = Column(String(15), nullable=False)
    telephone = Column(String(20), nullable=False)
    qq = Column(String(15), nullable=False)
    email = Column(String(30), nullable=False)
    is_secrecy = Column(TINYINT(1), nullable=False, server_default=text("'1'"),
                        comment='隐私状态[0-不对外显示仅接收通知|1-对外显示并接收通知]')


class XlxCompanyDirectoryCache(Base):
    __tablename__ = 'xlx_company_directory_cache'
    __table_args__ = (Index('index_mark', 'mark'), {'comment': '企业名录缓存表'})

    id = Column(INTEGER(10), primary_key=True)
    mark = Column(CHAR(32, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='记号')
    query = Column(String(500, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='查询条件')
    result = Column(Text(collation='utf8mb4_unicode_ci'), nullable=False, comment='查询结果')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    expire_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='到期时间')


class XlxCompanyDirectoryRecord(Base):
    __tablename__ = 'xlx_company_directory_record'
    __table_args__ = (Index('index_adminid', 'admin_id'), {'comment': '企业名录记录表'})

    id = Column(INTEGER(10), primary_key=True)
    admin_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='管理员ID')
    keyword = Column(String(100, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='关键词')
    query = Column(Text(collation='utf8mb4_unicode_ci'), nullable=False, comment='查询条件')
    current_page = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='当前页')
    current_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='当前页数量')
    total_page = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='总页数')
    total_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='总数量')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')


class XlxCompanyDownResume(Base):
    __tablename__ = 'xlx_company_down_resume'
    __table_args__ = (Index('index_personal_uid', 'personal_uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    comid = Column(INTEGER(10), nullable=False)
    resume_id = Column(INTEGER(10), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    platform = Column(String(30), nullable=False, server_default=text("''"))


class XlxCompanyImg(Base):
    __tablename__ = 'xlx_company_img'
    __table_args__ = (Index('index_comid_uid', 'comid', 'uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    comid = Column(INTEGER(10), nullable=False)
    img = Column(INTEGER(10), nullable=False)
    title = Column(VARCHAR(20), nullable=False)
    addtime = Column(INTEGER(100), nullable=False)
    audit = Column(TINYINT(1), nullable=False, server_default=text("'0'"))


class XlxCompanyInfo(Base):
    __tablename__ = 'xlx_company_info'
    __table_args__ = (Index('index_comid_uid', 'comid', 'uid', unique=True), Index('index_uid', 'uid', unique=True))

    id = Column(INTEGER(10), primary_key=True)
    comid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    website = Column(String(200), nullable=False)
    short_desc = Column(Text, nullable=False)
    content = Column(Text, nullable=False)
    address = Column(String(200), nullable=False)


class XlxCompanyInterview(Base):
    __tablename__ = 'xlx_company_interview'
    __table_args__ = (Index('index_personal_uid', 'personal_uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    comid = Column(INTEGER(10), nullable=False)
    companyname = Column(String(100), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    jobid = Column(INTEGER(10), nullable=False)
    jobname = Column(String(30), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)
    resume_id = Column(INTEGER(10), nullable=False)
    fullname = Column(String(30), nullable=False)
    interview_time = Column(INTEGER(10), nullable=False)
    contact = Column(String(30), nullable=False)
    address = Column(String(200), nullable=False)
    tel = Column(String(20), nullable=False)
    note = Column(String(100), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    is_look = Column(TINYINT(1), nullable=False)


class XlxCompanyInterviewVideo(Base):
    __tablename__ = 'xlx_company_interview_video'
    __table_args__ = (Index('index_personal_uid', 'personal_uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    comid = Column(INTEGER(10), nullable=False)
    companyname = Column(String(100), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    jobid = Column(INTEGER(10), nullable=False)
    jobname = Column(String(30), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)
    resume_id = Column(INTEGER(10), nullable=False)
    fullname = Column(String(30), nullable=False)
    interview_time = Column(INTEGER(10), nullable=False)
    contact = Column(String(30), nullable=False)
    tel = Column(String(20), nullable=False)
    deadline = Column(INTEGER(10), nullable=False)
    note = Column(String(100), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    is_look = Column(TINYINT(1), nullable=False)
    company_donotice_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    personal_donotice_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class XlxCompanyReport(Base):
    __tablename__ = 'xlx_company_report'
    __table_args__ = (Index('index_company_id', 'company_id', unique=True),)

    id = Column(INTEGER(10), primary_key=True, comment='主键id')
    uid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='会员id')
    company_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='公司id')
    corporate = Column(String(30), nullable=False, server_default=text("''"), comment='企业法人')
    com_type = Column(String(60), nullable=False, server_default=text("''"), comment='主体类型')
    reg_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创立时间')
    reg_capital = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='注册资金')
    reg_address = Column(String(100), nullable=False, server_default=text("''"), comment='注册地址')
    office_address = Column(String(100), nullable=False, server_default=text("''"), comment='办公地址')
    registrar = Column(String(60), nullable=False, server_default=text("''"), comment='登记机关')
    scope = Column(Text, nullable=False, comment='经营范围')
    office_area = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='办公面积')
    office_env = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='办公环境（1一般2良好3优美）')
    workplace = Column(String(30), nullable=False, server_default=text("''"), comment='办公场所')
    number = Column(String(30), nullable=False, server_default=text("''"), comment='员工人数')
    sex_ratio = Column(String(30), nullable=False, server_default=text("''"), comment='男女比例')
    average_age = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='平均年龄')
    route = Column(String(100), nullable=False, server_default=text("''"), comment='乘车路线')
    evaluation = Column(Text, nullable=False, comment='评价')
    addtime = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='认证时间')
    certifier = Column(String(30), nullable=False, server_default=text("''"), comment='认证师')
    img = Column(Text, comment='企业照片')


class XlxCompanyServiceEmergency(Base):
    __tablename__ = 'xlx_company_service_emergency'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    recommend = Column(TINYINT(1), nullable=False)
    days = Column(INTEGER(10), nullable=False)
    expense = Column(DECIMAL(10, 2), nullable=False)
    enable_points_deduct = Column(TINYINT(1), nullable=False)
    deduct_max = Column(DECIMAL(10, 2), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)


class XlxCompanyServiceIm(Base):
    __tablename__ = 'xlx_company_service_im'

    id = Column(INTEGER(10), primary_key=True, comment='id')
    name = Column(String(30), nullable=False, comment='名称')
    recommend = Column(TINYINT(1), nullable=False, comment='推荐1是2否')
    times = Column(INTEGER(10), nullable=False, comment='职聊次数')
    expense = Column(DECIMAL(10, 2), nullable=False, comment='价格')
    enable_points_deduct = Column(TINYINT(1), nullable=False, comment='可积分抵扣0否1可2部')
    deduct_max = Column(DECIMAL(10, 2), nullable=False, comment='可部分抵扣最大额')
    is_display = Column(TINYINT(1), nullable=False, comment='是否显示1是2否')
    sort_id = Column(INTEGER(10), nullable=False, comment='排序')


class XlxCompanyServicePoints(Base):
    __tablename__ = 'xlx_company_service_points'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    recommend = Column(TINYINT(1), nullable=False)
    points = Column(INTEGER(10), nullable=False)
    expense = Column(DECIMAL(10, 2), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)


class XlxCompanyServiceRefreshJobPackage(Base):
    __tablename__ = 'xlx_company_service_refresh_job_package'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    recommend = Column(TINYINT(1), nullable=False)
    times = Column(INTEGER(10), nullable=False)
    expense = Column(DECIMAL(10, 2), nullable=False)
    enable_points_deduct = Column(TINYINT(1), nullable=False)
    deduct_max = Column(DECIMAL(10, 2), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)


class XlxCompanyServiceResumePackage(Base):
    __tablename__ = 'xlx_company_service_resume_package'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    recommend = Column(TINYINT(1), nullable=False)
    download_resume_point = Column(INTEGER(10), nullable=False)
    expense = Column(DECIMAL(10, 2), nullable=False)
    enable_points_deduct = Column(TINYINT(1), nullable=False)
    deduct_max = Column(DECIMAL(10, 2), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)


class XlxCompanyServiceStick(Base):
    __tablename__ = 'xlx_company_service_stick'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    recommend = Column(TINYINT(1), nullable=False)
    days = Column(INTEGER(10), nullable=False)
    expense = Column(DECIMAL(10, 2), nullable=False)
    enable_points_deduct = Column(TINYINT(1), nullable=False)
    deduct_max = Column(DECIMAL(10, 2), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)


class XlxComplaint(Base):
    __tablename__ = 'xlx_complaint'
    __table_args__ = (
        Index('status', 'status'),
        Index('uid', 'uid')
    )

    id = Column(INTEGER(11), primary_key=True)
    uid = Column(INTEGER(11), nullable=False)
    complaint = Column(TINYINT(1), server_default=text("'1'"), comment='1投诉2举报')
    complainttype = Column(String(50), nullable=False, comment='投诉类型')
    content = Column(Text, nullable=False, comment='投诉内容')
    project = Column(String(100), comment='项目方')
    zbdwname = Column(String(100), comment='总包单位')
    signcontract = Column(TINYINT(1), server_default=text("'1'"), comment='是否签署劳动合同1是2否')
    contractattachments = Column(String(255), comment='添加合同附件')
    attendance = Column(TINYINT(1), comment='本人是否落实实名制考勤1是2否')
    totalattendance = Column(INTEGER(11), comment='考勤总月数')
    workt = Column(String(50), comment='工种')
    payoff = Column(INTEGER(11), comment='已发工资月数')
    amount = Column(DECIMAL(10, 2), comment='已发工资金额')
    arrearsmonths = Column(INTEGER(11), comment='拖欠工资月数')
    arrearsamount = Column(DECIMAL(10, 2), comment='拖欠工资金额')
    unpaidwagest = Column(TINYINT(1), comment='拖欠工资种类1个人2团队')
    wagearrearspep = Column(INTEGER(11), comment='拖欠工资人数')
    totalamountwages = Column(DECIMAL(10, 2), comment='拖欠工资总金额')
    name = Column(String(50), comment='姓名')
    card = Column(String(20), comment='身份证号码')
    phone = Column(String(15), comment='联系电话')
    nation = Column(String(15), comment='民族')
    area = Column(String(120), comment='地区')
    address = Column(String(255), comment='详细地址')
    reportfiles = Column(String(255), comment='添加投诉举报凭证')
    addtime = Column(INTEGER(11))
    status = Column(Enum('未处理', '处理中', '已解决', '已关闭'), server_default=text("'未处理'"),
                    comment="'未处理', '处理中', '已解决', '已关闭'")
    reply_content = Column(Text, comment='回复内容')
    reply_time = Column(INTEGER(11), comment='回复时间')


class XlxConfig(Base):
    __tablename__ = 'xlx_config'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(100), nullable=False)
    is_frontend = Column(TINYINT(1), nullable=False)
    value = Column(MEDIUMTEXT, nullable=False)
    note = Column(String(100), nullable=False)
    is_secret = Column(TINYINT(1), nullable=False)


class XlxCoupon(Base):
    __tablename__ = 'xlx_coupon'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    face_value = Column(Float(10, True), nullable=False)
    bind_setmeal_id = Column(INTEGER(10), nullable=False)
    days = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxCouponLog(Base):
    __tablename__ = 'xlx_coupon_log'

    id = Column(INTEGER(10), primary_key=True)
    coupon_id = Column(Text, nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    admin_name = Column(String(30), nullable=False)


class XlxCouponRecord(Base):
    __tablename__ = 'xlx_coupon_record'
    __table_args__ = (Index('index_log_id', 'log_id'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    log_id = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    coupon_name = Column(String(30), nullable=False)
    coupon_face_value = Column(Float(10, True), nullable=False)
    coupon_bind_setmeal_id = Column(INTEGER(10), nullable=False)
    deadline = Column(INTEGER(10), nullable=False)
    usetime = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxCrmAutoAssign(Base):
    __tablename__ = 'xlx_crm_auto_assign'
    __table_args__ = {'comment': 'CRM线索/客户自动分配规则（管理员）表'}

    id = Column(INTEGER(10), primary_key=True, comment='线索/客户自动分配ID')
    type = Column(TINYINT(1), nullable=False, server_default=text("'1'"),
                  comment='类型【1:线索自动分配;2:客户自动分配;】')
    admin_id = Column(INTEGER(10), nullable=False, comment='后台管理员ID')
    assign_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='已分配数量')
    create_time = Column(INTEGER(10), nullable=False, comment='创建时间')


class XlxCrmBackUp(Base):
    __tablename__ = 'xlx_crm_back_up'
    __table_args__ = {'comment': 'CRM备份表'}

    id = Column(INTEGER(10), primary_key=True, comment='备份ID')
    model = Column(String(255, 'utf8mb4_unicode_ci'), nullable=False, comment='模型')
    recycle_bin_id = Column(INTEGER(10), nullable=False, comment='回收站ID')
    value = Column(LONGTEXT, comment='数据')
    create_time = Column(INTEGER(10), comment='备份时间')


class XlxCrmClue(Base):
    __tablename__ = 'xlx_crm_clue'
    __table_args__ = (Index('index_mobile', 'mobile'), {'comment': 'crm线索表'})

    id = Column(INTEGER(10), primary_key=True)
    name = Column(VARCHAR(50), nullable=False, comment='线索名称')
    admin_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='所属销售')
    mobile = Column(VARCHAR(11), nullable=False, comment='联系电话')
    contacts = Column(VARCHAR(30), nullable=False, comment='联系人')
    weixin = Column(VARCHAR(30), nullable=False, comment='微信')
    district1 = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='地区分类1级')
    district2 = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='地区分类2级')
    district3 = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='地区分类3级')
    district = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='地区分类最后一级')
    address = Column(VARCHAR(50), nullable=False, comment='详细地址')
    updatetime = Column(INTEGER(10), nullable=False, comment='更新时间')
    createtime = Column(INTEGER(10), nullable=False, comment='创建时间')
    creat_id = Column(INTEGER(10), nullable=False, comment='创建人id')
    remark = Column(VARCHAR(50), nullable=False, comment='备注')
    uid = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    utype = Column(TINYINT(1), nullable=False, server_default=text("'0'"),
                   comment='用户类型【0:线索;1:企业客户;2:个人客户;】')
    trade = Column(INTEGER(10), nullable=False, comment='客户行业')
    last_visit_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后跟进时间')
    last_visit_admin = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后跟进人')
    is_customer = Column(ENUM('1', '0'), nullable=False, server_default=text("'0'"), comment='是否转为客户 0-否 1-是')
    scale = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='公司规模')
    collection_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='领取时间')
    tripartite_id = Column(String(50, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"),
                           comment='三方ID')
    telephone = Column(String(20, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='固话')


class XlxCrmClueContact(Base):
    __tablename__ = 'xlx_crm_clue_contact'
    __table_args__ = (
        Index('index_cid_ism', 'clue_id', 'is_main'), Index('index_mobile', 'mobile'), {'comment': '线索联系人表'})

    id = Column(INTEGER(10), primary_key=True)
    clue_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='线索ID')
    contact = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='联系人')
    mobile = Column(CHAR(11, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='手机号')
    telephone = Column(String(20, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='固话')
    qq = Column(String(15, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='QQ')
    email = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='邮箱')
    sex = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='性别：0|男，1|女')
    addtime = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='添加时间')
    updatetime = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    is_main = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否设为主要：0|否，1|是')


class XlxCrmClueRelease(Base):
    __tablename__ = 'xlx_crm_clue_release'
    __table_args__ = {'comment': 'crm线索释放记录表'}

    id = Column(INTEGER(10), primary_key=True)
    clue_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='线索id')
    create_time = Column(INTEGER(10), nullable=False, comment='操作时间')
    operation_type = Column(TINYINT(1), nullable=False, comment='操作类型 1-领取 2-释放')
    admin_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='所属销售人id')
    operator = Column(TINYINT(1), nullable=False, comment='操作人员  1-系统 2-销售')
    utype = Column(TINYINT(1), nullable=False, server_default=text("'0'"),
                   comment='跟进用户【0:线索;1:企业客户;2:个人客户;】')
    uid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='UID')


class XlxCrmCompanyContact(Base):
    __tablename__ = 'xlx_crm_company_contact'
    __table_args__ = {'comment': '企业联系方式表'}

    id = Column(INTEGER(10), primary_key=True, comment='id')
    comid = Column(INTEGER(10), nullable=False, comment='企业id')
    uid = Column(INTEGER(10), nullable=False, comment='企业uid')
    contact = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, comment='企业联系人')
    mobile = Column(String(11, 'utf8mb4_unicode_ci'), nullable=False, comment='联系电话')
    weixin = Column(String(15, 'utf8mb4_unicode_ci'), nullable=False, comment='联系微信')
    telephone = Column(String(20, 'utf8mb4_unicode_ci'), nullable=False, comment='联系固话')
    qq = Column(String(15, 'utf8mb4_unicode_ci'), nullable=False, comment='联系QQ')
    email = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, comment='电子邮箱')
    sex = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='性别 0-男 1-女')
    addtime = Column(INTEGER(10), nullable=False, comment='添加时间')
    updatetime = Column(INTEGER(10), nullable=False, comment='更新时间')


class XlxCrmCustomList(Base):
    __tablename__ = 'xlx_crm_custom_list'
    __table_args__ = {'comment': 'crm自定义列表'}

    id = Column(INTEGER(10), primary_key=True)
    menu = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='1-全部 2-公海 3-我的')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='类型 1-线索  2-企业')
    value = Column(TEXT, nullable=False, comment='自定义列表')
    admin_id = Column(INTEGER(10), nullable=False, comment='操作人')


class XlxCrmCustomerService(Base):
    __tablename__ = 'xlx_crm_customer_service'
    __table_args__ = {'comment': 'crm个人中心客服(客服名片)'}

    id = Column(INTEGER(10), primary_key=True)
    photo = Column(INTEGER(10), nullable=False, comment='头像id')
    name = Column(VARCHAR(30), nullable=False, comment='姓名')
    mobile = Column(VARCHAR(11), nullable=False, comment='手机号')
    tel = Column(VARCHAR(30), nullable=False, comment='固话')
    wx_qrcode = Column(INTEGER(10), nullable=False, comment='微信id')
    qq = Column(VARCHAR(20), nullable=False, comment='qq')
    admin_id = Column(INTEGER(10), nullable=False, comment='管理员id')
    addtime = Column(INTEGER(10), nullable=False, comment='添加时间')
    updatetime = Column(INTEGER(10), nullable=False, comment='修改时间')


class XlxCrmFollowUp(Base):
    __tablename__ = 'xlx_crm_follow_up'
    __table_args__ = (Index('idx_clueid_type', 'clue_id', 'type'), {'comment': 'CRM跟进记录'})

    id = Column(INTEGER(10), primary_key=True, comment='跟进记录id')
    type = Column(TINYINT(1), nullable=False, server_default=text("'1'"),
                  comment='跟进类型【1:线索跟进;2:客户跟进;3:客勤跟进;】')
    clue_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='线索ID')
    uid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='UID')
    admin_id = Column(INTEGER(10), nullable=False, comment='跟进人ID')
    utype = Column(TINYINT(1), nullable=False, server_default=text("'0'"),
                   comment='跟进用户【0:线索;1:企业客户;2:个人客户;】')
    mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"),
                  comment='跟进方式【0:其他;1:当面拜访;2:电话拜访;3:网络拜访;】')
    next_time = Column(INTEGER(10), nullable=False, comment='下次跟进时间')
    result = Column(String(255, 'utf8mb4_unicode_ci'), nullable=False, comment='跟进结果')
    create_time = Column(INTEGER(10), nullable=False, comment='跟进时间')
    link_man = Column(String(10, 'utf8mb4_unicode_ci'), nullable=False, comment='联系人')
    link_mobile = Column(CHAR(11, 'utf8mb4_unicode_ci'), nullable=False, comment='联系人电话')
    linkman_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='联系人ID')
    relation_id = Column(INTEGER(10), server_default=text("'0'"), comment='关联ID【企业:cid;个人:rid】')
    enclosure = Column(Text(collation='utf8mb4_unicode_ci'), comment='附件')


class XlxCrmLifeCycle(Base):
    __tablename__ = 'xlx_crm_life_cycle'
    __table_args__ = {'comment': 'CRM客户等级（生命周期）'}

    id = Column(TINYINT(10), primary_key=True, comment='主键(生命周期)ID')
    name = Column(String(255, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"),
                  comment='生命周期阶段名')
    is_open = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否开启[0:否;1:是]')
    is_system = Column(TINYINT(1), nullable=False, server_default=text("'0'"),
                       comment='是否系统内置不可编辑项[0:否;1:是]')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后编辑时间')


class XlxCrmRecycleBin(Base):
    __tablename__ = 'xlx_crm_recycle_bin'
    __table_args__ = {'comment': 'CRM回收站表'}

    id = Column(INTEGER(10), primary_key=True, comment='回收站ID')
    cid = Column(INTEGER(10), nullable=False, comment='company_id')
    uid = Column(INTEGER(10), nullable=False, comment='uid')
    mobile = Column(CHAR(11, 'utf8mb4_unicode_ci'), nullable=False, comment='会员联系方式')
    companyname = Column(String(60, 'utf8mb4_unicode_ci'), nullable=False, comment='企业名称')
    contact = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, comment='企业联系人')
    contact_mobile = Column(CHAR(11, 'utf8mb4_unicode_ci'), nullable=False, comment='企业联系人电话')
    life_cycle_id = Column(INTEGER(10), nullable=False, comment='客户等级ID')
    life_cycle_name = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, comment='客户等级阶段名')
    admin_id = Column(INTEGER(10), nullable=False, comment='所属销售ID')
    last_visit_time = Column(INTEGER(10), nullable=False, comment='最后跟进')
    refreshtime = Column(INTEGER(11), nullable=False, comment='刷新时间')
    addtime = Column(INTEGER(11), nullable=False, comment='企业添加时间')
    reg_time = Column(INTEGER(10), nullable=False, comment='注册时间')
    last_login_time = Column(INTEGER(10), nullable=False, comment='最后登录时间')
    setmeal_id = Column(INTEGER(10), nullable=False, comment='套餐ID')
    setmeal_name = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, comment='套餐名称')
    setmeal_deadline = Column(INTEGER(10), nullable=False, comment='套餐到期时间')
    jobs_num = Column(INTEGER(10), nullable=False, comment='在招职位')
    job_apply_count = Column(INTEGER(10), nullable=False, comment='收到简历')
    create_time = Column(INTEGER(10), nullable=False, comment='放入回收站时间')
    status = Column(TINYINT(1), nullable=False, server_default=text("'1'"),
                    comment='状态【1:放入回收站;2:已恢复;3:已删除;】')
    update_time = Column(INTEGER(10), nullable=False, comment='操作时间')
    operate_id = Column(INTEGER(10), nullable=False, comment='操作管理员id')
    operate_admin = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, comment='操作管理员')


class XlxCrmSysConfig(Base):
    __tablename__ = 'xlx_crm_sys_config'
    __table_args__ = {'comment': 'CRM系统配置'}

    id = Column(TINYINT(10), primary_key=True, comment='主键(配置项ID)ID')
    category = Column(String(20, 'utf8mb4_unicode_ci'), nullable=False, comment='配置项所属类型')
    name = Column(String(255, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='配置项名称')
    key = Column(String(100, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='配置项键')
    value = Column(String(255, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='配置项值')
    is_open = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否开启[0:否;1:是]')
    is_system = Column(TINYINT(1), nullable=False, server_default=text("'0'"),
                       comment='是否系统内置不可编辑项[0:否;1:是]')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最后编辑时间')
    remark = Column(String(255, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='注释')


class XlxCrmTag(Base):
    __tablename__ = 'xlx_crm_tag'
    __table_args__ = {'comment': 'CRM客户标签'}

    id = Column(INTEGER(10), primary_key=True, comment='标签ID')
    name = Column(String(45, 'utf8mb4_unicode_ci'), nullable=False, comment='标签名称')
    order = Column(INTEGER(10), nullable=False, comment='排序')
    create_time = Column(INTEGER(10), nullable=False, comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, comment='更新时间')


class XlxCron(Base):
    __tablename__ = 'xlx_cron'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    action = Column(String(30), nullable=False)
    weekday = Column(TINYINT(1), nullable=False)
    day = Column(TINYINT(2), nullable=False)
    hour = Column(TINYINT(2), nullable=False)
    minute = Column(String(10), nullable=False)
    next_execute_time = Column(INTEGER(10), nullable=False)
    last_execute_time = Column(INTEGER(10), nullable=False)
    status = Column(TINYINT(1), nullable=False)
    is_sys = Column(TINYINT(1), nullable=False)
    disable_edit = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    refresh_quantity = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='简历刷新数量')


class XlxCronLog(Base):
    __tablename__ = 'xlx_cron_log'

    id = Column(INTEGER(10), primary_key=True)
    cron_id = Column(INTEGER(10), nullable=False)
    cron_name = Column(String(30), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    seconds = Column(Float(10, True), nullable=False)
    is_auto = Column(TINYINT(1), nullable=False)


class XlxCustomList(Base):
    __tablename__ = 'xlx_custom_list'
    __table_args__ = {'comment': '自定义表单记录表'}

    id = Column(INTEGER(10), primary_key=True)
    name = Column(VARCHAR(30), nullable=False, comment='配置名称')
    value = Column(TEXT, nullable=False, comment='自定义列表')
    admin_id = Column(INTEGER(10), nullable=False, comment='操作人')


class XlxCustomerService(Base):
    __tablename__ = 'xlx_customer_service'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    photo = Column(INTEGER(10), nullable=False)
    mobile = Column(String(11), nullable=False)
    tel = Column(String(30), nullable=False)
    weixin = Column(String(30), nullable=False)
    qq = Column(String(20), nullable=False)
    status = Column(TINYINT(1), nullable=False)
    wx_qrcode = Column(INTEGER(10), nullable=False)


class XlxCustomerServiceComplaint(Base):
    __tablename__ = 'xlx_customer_service_complaint'

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    cs_id = Column(INTEGER(10), nullable=False)
    content = Column(String(255), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    status = Column(TINYINT(1), nullable=False)


class XlxEntrust(Base):
    __tablename__ = 'xlx_entrust'

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    days = Column(INTEGER(10), nullable=False)
    deadline = Column(INTEGER(10), nullable=False)


class XlxExplain(Base):
    __tablename__ = 'xlx_explain'
    __table_args__ = (Index('index_addtime', 'addtime'), Index('index_sort_id', 'sort_id'))

    id = Column(INTEGER(10), primary_key=True)
    title = Column(String(100), nullable=False)
    content = Column(LONGTEXT, nullable=False)
    attach = Column(Text, nullable=False)
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    link_url = Column(String(200), nullable=False, server_default=text("''"))
    seo_keywords = Column(String(100), nullable=False, server_default=text("''"))
    seo_description = Column(String(200), nullable=False, server_default=text("''"))
    addtime = Column(INTEGER(10), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class XlxFavJob(Base):
    __tablename__ = 'xlx_fav_job'
    __table_args__ = (Index('index_company_uid', 'company_uid'), Index('index_personal_uid', 'personal_uid'))

    id = Column(INTEGER(10), primary_key=True)
    company_uid = Column(INTEGER(10), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)
    jobid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxFavResume(Base):
    __tablename__ = 'xlx_fav_resume'
    __table_args__ = (Index('index_company_uid', 'company_uid'), Index('index_personal_uid', 'personal_uid'))

    id = Column(INTEGER(10), primary_key=True)
    company_uid = Column(INTEGER(10), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)
    resume_id = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxFeedback(Base):
    __tablename__ = 'xlx_feedback'

    id = Column(INTEGER(10), primary_key=True)
    type = Column(TINYINT(1), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    utype = Column(TINYINT(1), nullable=False)
    content = Column(String(255), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    status = Column(TINYINT(1), nullable=False)


class XlxFieldRule(Base):
    __tablename__ = 'xlx_field_rule'

    id = Column(INTEGER(10), primary_key=True)
    model_name = Column(String(30), nullable=False)
    field_name = Column(String(30), nullable=False)
    is_require = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    enable_close = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    field_cn = Column(String(10), nullable=False)
    is_custom = Column(TINYINT(1), nullable=False)


class XlxGuestbook(Base):
    __tablename__ = 'xlx_guestbook'
    __table_args__ = (
        Index('index_uid_parent_id', 'uid', 'parent_id'),
    )

    id = Column(INTEGER(11), primary_key=True)
    uid = Column(INTEGER(11), nullable=False)
    content = Column(Text, nullable=False, comment='内容')
    parent_id = Column(INTEGER(11), comment='父级ID')
    suggest = Column(VARCHAR(255), comment='建议目的')
    types = Column(VARCHAR(255), comment='留言类型')
    entryname = Column(VARCHAR(255), comment='项目名称')
    constructionunitname = Column(VARCHAR(255), comment='施工单位名称')
    zbdwname = Column(VARCHAR(255), comment='总包单位名称')
    phonenumber = Column(VARCHAR(255), comment='手机号码')
    title = Column(VARCHAR(255), comment='标题')
    lock = Column(TINYINT(1), server_default=text("'0'"), comment='是否锁定0正常1锁定')
    addtime = Column(INTEGER(11), comment='添加时间')


class XlxTrain(Base):
    __tablename__ = 'xlx_train'

    id = Column(INTEGER(11), primary_key=True)
    title = Column(VARCHAR(255), comment='标题')
    video = Column(VARCHAR(255), comment='标题')
    addtime = Column(INTEGER(11), comment='添加时间')


class XlxHelp(Base):
    __tablename__ = 'xlx_help'
    __table_args__ = (Index('index_cid_sort_id', 'cid', 'sort_id'),)

    id = Column(INTEGER(10), primary_key=True)
    cid = Column(INTEGER(10), nullable=False)
    title = Column(String(100), nullable=False)
    content = Column(LONGTEXT, nullable=False)
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    seo_keywords = Column(String(100), nullable=False, server_default=text("''"))
    seo_description = Column(String(200), nullable=False, server_default=text("''"))
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class XlxHelpCategory(Base):
    __tablename__ = 'xlx_help_category'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(10), nullable=False)
    is_sys = Column(TINYINT(1), nullable=False, server_default=text("'1'"))


class XlxHotword(Base):
    __tablename__ = 'xlx_hotword'
    __table_args__ = (Index('index_hot', 'hot'), Index('index_word', 'word'))

    id = Column(INTEGER(10), primary_key=True)
    word = Column(String(120), nullable=False)
    hot = Column(INTEGER(10), nullable=False, server_default=text("'1'"))


class XlxHrtool(Base):
    __tablename__ = 'xlx_hrtool'

    id = Column(INTEGER(10), primary_key=True)
    cid = Column(INTEGER(10), nullable=False)
    filename = Column(String(200), nullable=False)
    fileurl = Column(String(200), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class XlxHrtoolCategory(Base):
    __tablename__ = 'xlx_hrtool_category'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(80), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    is_sys = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    describe = Column(String(200), nullable=False, server_default=text("''"))


class XlxIdentityToken(Base):
    __tablename__ = 'xlx_identity_token'
    __table_args__ = (Index('index_expire', 'expire'), Index('index_token', 'mdtoken'), Index('index_uid', 'uid'),
                      {'comment': '登录凭证记录表'})

    mdtoken = Column(String(32), primary_key=True, comment='token')
    updatetime = Column(INTEGER(10), nullable=False, comment='更新时间')
    uid = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='用户uid')
    expire = Column(INTEGER(10), nullable=False, comment='过期时间')


t_xlx_im_forbid = Table('xlx_im_forbid', metadata, Column('uid', INTEGER(10), nullable=False, comment='uid'),
                        Column('addtime', INTEGER(10), nullable=False, comment='最后登录时间'),
                        Column('reason', String(30), nullable=False, comment='最后登录ip'))


class XlxImQuickmsg(Base):
    __tablename__ = 'xlx_im_quickmsg'

    id = Column(INTEGER(10), primary_key=True)
    content = Column(String(100), nullable=False)
    utype = Column(TINYINT(1), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)


class XlxImRule(Base):
    __tablename__ = 'xlx_im_rule'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    value = Column(String(100), nullable=False)
    utype = Column(TINYINT(1), nullable=False)
    note = Column(String(30), nullable=False)


class XlxImShortUrl(Base):
    __tablename__ = 'xlx_im_short_url'
    __table_args__ = {'comment': 'IM聊天页面短链接'}

    id = Column(INTEGER(11), primary_key=True)
    url = Column(String(255, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='原始链接')
    code = Column(CHAR(13, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='短码')
    uid = Column(INTEGER(10), nullable=False, comment='uid')
    addtime = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    pv = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='点击量')


class XlxImToken(Base):
    __tablename__ = 'xlx_im_token'
    __table_args__ = (Index('index_uid', 'uid', unique=True),)

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    im_userid = Column(String(50), nullable=False)
    token = Column(String(200), nullable=False)


class XlxImUnreadRemind(Base):
    __tablename__ = 'xlx_im_unread_remind'

    id = Column(INTEGER(10), primary_key=True, comment='主键ID')
    to_uid = Column(INTEGER(10), nullable=False, comment='消息接收方UID')
    from_uid = Column(INTEGER(10), nullable=False, comment='消息发送方UID')
    job_id = Column(INTEGER(10), nullable=False, comment='职位ID')
    chat_id = Column(String(32), nullable=False, comment='聊天ID')
    stick = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='置顶')
    message_id = Column(String(32), nullable=False, comment='消息ID')
    keyword = Column(String(255), nullable=False, comment='留言内容')
    type = Column(String(20), nullable=False, comment='消息类型')
    remind_mode = Column(TINYINT(1), nullable=False, server_default=text("'0'"),
                         comment='提醒方式[0:失败;1:微信公众号模板消息;2:短信提醒;]')
    add_time = Column(INTEGER(10), nullable=False, comment='消息时间')
    message = Column(Text, comment='消息内容')


class XlxJob(Base):
    __tablename__ = 'xlx_job'
    __table_args__ = (Index('index_uid', 'uid'),)

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    company_id = Column(INTEGER(10), nullable=False)
    jobname = Column(String(50), nullable=False)
    emergency = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    stick = Column(TINYINT(1), nullable=False)
    nature = Column(INTEGER(10), nullable=False)
    sex = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    category1 = Column(INTEGER(10), nullable=False)
    category2 = Column(INTEGER(10), nullable=False)
    category3 = Column(INTEGER(10), nullable=False)
    category = Column(INTEGER(10), nullable=False)
    minwage = Column(INTEGER(10), nullable=False)
    maxwage = Column(INTEGER(10), nullable=False)
    negotiable = Column(TINYINT(1), nullable=False)
    education = Column(INTEGER(10), nullable=False)
    experience = Column(INTEGER(10), nullable=False)
    content = Column(Text, nullable=False)
    tag = Column(String(100), nullable=False)
    amount = Column(SMALLINT(5), nullable=False)
    department = Column(String(15), nullable=False)
    minage = Column(TINYINT(2), nullable=False)
    maxage = Column(TINYINT(2), nullable=False)
    age_na = Column(TINYINT(1), nullable=False)
    district1 = Column(INTEGER(10), nullable=False)
    district2 = Column(INTEGER(10), nullable=False)
    district3 = Column(INTEGER(10), nullable=False)
    district = Column(INTEGER(10), nullable=False)
    address = Column(String(200), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    refreshtime = Column(INTEGER(10), nullable=False)
    updatetime = Column(INTEGER(10), nullable=False, comment='更新时间')
    setmeal_id = Column(INTEGER(10), nullable=False)
    audit = Column(TINYINT(1), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    click = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    user_status = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    robot = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    map_lat = Column(DECIMAL(9, 6), nullable=False, comment='纬度')
    map_lng = Column(DECIMAL(9, 6), nullable=False, comment='经度')
    map_zoom = Column(TINYINT(3), nullable=False)
    custom_field_1 = Column(String(255), nullable=False, server_default=text("''"))
    custom_field_2 = Column(String(255), nullable=False, server_default=text("''"))
    custom_field_3 = Column(String(255), nullable=False, server_default=text("''"))
    platform = Column(String(30), nullable=False, server_default=text("''"))
    need_notice = Column(TINYINT(1), nullable=False, server_default=text("'1'"),
                         comment='接收通知(联系手机接收投递通知):1|是;0:否')


class XlxJobApply(Base):
    __tablename__ = 'xlx_job_apply'
    __table_args__ = (Index('index_company_uid', 'company_uid'), Index('index_personal_uid', 'personal_uid'))

    id = Column(INTEGER(10), primary_key=True)
    comid = Column(INTEGER(10), nullable=False)
    companyname = Column(String(100), nullable=False)
    company_uid = Column(INTEGER(10), nullable=False)
    jobid = Column(INTEGER(10), nullable=False)
    jobname = Column(String(30), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)
    resume_id = Column(INTEGER(10), nullable=False)
    fullname = Column(String(30), nullable=False)
    note = Column(String(100), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    is_look = Column(TINYINT(1), nullable=False)
    handle_status = Column(TINYINT(1), nullable=False)
    source = Column(TINYINT(1), nullable=False, comment='0自主投递 1委托投递')
    platform = Column(String(30), nullable=False, server_default=text("''"))
    free_viewing = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否免费查看简历:0|否;1|是')
    free_viewing_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='查看时间')


class XlxJobAuditLog(Base):
    __tablename__ = 'xlx_job_audit_log'

    id = Column(INTEGER(10), primary_key=True)
    jobid = Column(INTEGER(10), nullable=False)
    audit = Column(TINYINT(1), nullable=False)
    reason = Column(String(200), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxJobContact(Base):
    __tablename__ = 'xlx_job_contact'
    __table_args__ = (Index('index_jid_uid', 'jid', 'uid', unique=True),)

    id = Column(INTEGER(10), primary_key=True)
    jid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    contact = Column(String(30), nullable=False)
    mobile = Column(String(11), nullable=False)
    weixin = Column(String(15), nullable=False)
    telephone = Column(String(20), nullable=False)
    qq = Column(String(15), nullable=False)
    email = Column(String(30), nullable=False)
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    use_company_contact = Column(TINYINT(1), nullable=False)
    is_secrecy = Column(TINYINT(1), nullable=False, server_default=text("'1'"),
                        comment='隐私状态[0-不对外显示仅接收通知|1-对外显示并接收通知]')


class XlxJobSearchKey(Base):
    __tablename__ = 'xlx_job_search_key'
    __table_args__ = (Index('index_company_id', 'company_id'), Index('index_company_nature', 'company_nature'),
                      Index('index_companyname', 'companyname'), Index('index_fulltext_index', 'jobname', 'companyname',
                                                                       'company_nature'), Index('index_jobname',
                                                                                                'jobname'),
                      Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    company_id = Column(INTEGER(10), nullable=False)
    company_nature_id = Column(INTEGER(10), nullable=False)
    emergency = Column(TINYINT(1), nullable=False)
    license = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    stick = Column(TINYINT(1), nullable=False)
    setmeal_id = Column(INTEGER(10), nullable=False)
    nature = Column(INTEGER(10), nullable=False)
    category1 = Column(INTEGER(10), nullable=False)
    category2 = Column(INTEGER(10), nullable=False)
    category3 = Column(INTEGER(10), nullable=False)
    category = Column(INTEGER(10), nullable=False)
    trade = Column(INTEGER(10), nullable=False)
    scale = Column(INTEGER(10), nullable=False)
    district1 = Column(INTEGER(10), nullable=False)
    district2 = Column(INTEGER(10), nullable=False)
    district3 = Column(INTEGER(10), nullable=False)
    district = Column(INTEGER(10), nullable=False)
    tag = Column(String(100), nullable=False)
    education = Column(INTEGER(10), nullable=False)
    experience = Column(INTEGER(10), nullable=False)
    minwage = Column(INTEGER(10), nullable=False)
    maxwage = Column(INTEGER(10), nullable=False)
    refreshtime = Column(INTEGER(10), nullable=False)
    map_lat = Column(DECIMAL(9, 6), nullable=False, comment='纬度')
    map_lng = Column(DECIMAL(9, 6), nullable=False, comment='经度')
    jobname = Column(String(50), nullable=False)
    companyname = Column(String(50), nullable=False)
    company_nature = Column(String(20), nullable=False)
    job_category = Column(String(255), nullable=False, server_default=text("''"), comment='职位类别')


class XlxJobSearchRtime(Base):
    __tablename__ = 'xlx_job_search_rtime'
    __table_args__ = (Index('index_category1', 'category1'), Index('index_company_id', 'company_id'),
                      Index('index_emergency_rtime', 'emergency',
                            'refreshtime'), Index('index_rtime', 'refreshtime'),
                      Index('index_stick_rtime', 'stick', 'refreshtime'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    company_id = Column(INTEGER(10), nullable=False)
    company_nature_id = Column(INTEGER(10), nullable=False)
    emergency = Column(TINYINT(1), nullable=False)
    license = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    stick = Column(TINYINT(1), nullable=False)
    setmeal_id = Column(INTEGER(10), nullable=False)
    nature = Column(INTEGER(10), nullable=False)
    category1 = Column(INTEGER(10), nullable=False)
    category2 = Column(INTEGER(10), nullable=False)
    category3 = Column(INTEGER(10), nullable=False)
    category = Column(INTEGER(10), nullable=False)
    trade = Column(INTEGER(10), nullable=False)
    scale = Column(INTEGER(10), nullable=False)
    district1 = Column(INTEGER(10), nullable=False)
    district2 = Column(INTEGER(10), nullable=False)
    district3 = Column(INTEGER(10), nullable=False)
    district = Column(INTEGER(10), nullable=False)
    tag = Column(String(100), nullable=False)
    education = Column(INTEGER(10), nullable=False)
    experience = Column(INTEGER(10), nullable=False)
    minwage = Column(INTEGER(10), nullable=False)
    maxwage = Column(INTEGER(10), nullable=False)
    refreshtime = Column(INTEGER(10), nullable=False)
    map_lat = Column(DECIMAL(9, 6), nullable=False, comment='纬度')
    map_lng = Column(DECIMAL(9, 6), nullable=False, comment='经度')


class XlxJobfairOnline(Base):
    __tablename__ = 'xlx_jobfair_online'

    id = Column(INTEGER(10), primary_key=True)
    title = Column(String(200), nullable=False)
    thumb = Column(INTEGER(10), nullable=False)
    starttime = Column(INTEGER(10), nullable=False)
    endtime = Column(INTEGER(10), nullable=False)
    content = Column(LONGTEXT, nullable=False)
    enable_setmeal_id = Column(String(100), nullable=False)
    must_company_audit = Column(TINYINT(1), nullable=False)
    min_complete_percent = Column(INTEGER(10), nullable=False)
    click = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    qrcode = Column(INTEGER(10), nullable=False)
    pc_header_logo = Column(INTEGER(10), nullable=False, comment='pc头部图片id')
    mobile_header_logo = Column(INTEGER(10), nullable=False, comment='触屏头部图片id')
    display = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否显示:0|否;1|是')


class XlxJobfairOnlineParticipate(Base):
    __tablename__ = 'xlx_jobfair_online_participate'

    id = Column(INTEGER(10), primary_key=True)
    jobfair_id = Column(INTEGER(10), nullable=False)
    utype = Column(TINYINT(1), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    audit = Column(TINYINT(1), nullable=False)
    qrcode = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    source = Column(TINYINT(1), nullable=False)
    stick = Column(TINYINT(1), nullable=False)
    note = Column(Text)


class XlxJobfairOnlineViewLog(Base):
    __tablename__ = 'xlx_jobfair_online_view_log'
    __table_args__ = {'comment': '网络招聘会查看记录表'}

    id = Column(INTEGER(11), primary_key=True)
    uid = Column(INTEGER(11), nullable=False, comment='uid')
    addtime = Column(INTEGER(11), nullable=False, comment='添加时间')
    type = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='查看类型 1-企业 2-职位 3-简历')
    content_id = Column(INTEGER(10), nullable=False, comment='查看内容id（企业id/职位id/会员简历id）')
    photo_img = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='头像id')


class XlxLink(Base):
    __tablename__ = 'xlx_link'
    __table_args__ = (Index('index_show_order', 'sort_id'),)

    id = Column(INTEGER(10), primary_key=True)
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    name = Column(String(20), nullable=False)
    link_url = Column(String(255), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    notes = Column(String(100), nullable=False, server_default=text("''"))


class XlxMailTpl(Base):
    __tablename__ = 'xlx_mail_tpl'

    id = Column(INTEGER(10), primary_key=True)
    alias = Column(String(30), nullable=False)
    name = Column(String(100), nullable=False)
    title = Column(Text, nullable=False)
    value = Column(Text, nullable=False)
    variate = Column(Text, nullable=False)
    status = Column(TINYINT(1), nullable=False)


class XlxMarketQueue(Base):
    __tablename__ = 'xlx_market_queue'
    __table_args__ = (Index('index_task_id', 'task_id'),)

    id = Column(INTEGER(10), primary_key=True)
    task_id = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    message = Column(TINYINT(1), nullable=False)
    mobile = Column(String(15), nullable=False)
    email = Column(String(50), nullable=False)
    weixin_openid = Column(String(50), nullable=False)


class XlxMarketTask(Base):
    __tablename__ = 'xlx_market_task'

    id = Column(INTEGER(10), primary_key=True)
    title = Column(String(30), nullable=False)
    content = Column(Text, nullable=False)
    send_type = Column(String(30), nullable=False)
    target = Column(String(30), nullable=False)
    condition = Column(Text, nullable=False)
    total = Column(INTEGER(10), nullable=False)
    success = Column(INTEGER(10), nullable=False)
    status = Column(TINYINT(1), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxMarketTpl(Base):
    __tablename__ = 'xlx_market_tpl'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    content = Column(Text, nullable=False)


class XlxMarketingTemplate(Base):
    __tablename__ = 'xlx_marketing_template'

    id = Column(INTEGER(10), primary_key=True, comment='主键ID（模板ID）')
    type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='模板类型[1:职位模板;2:企业模板;]')
    built_in = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='内置模版[0:否;1:是]')
    name = Column(String(100), nullable=False, server_default=text("''"), comment='模板名称')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    update_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='更新时间')
    head = Column(LONGTEXT, comment='头部模板')
    body = Column(LONGTEXT, comment='内容（职位/企业）模板')
    tail = Column(LONGTEXT, comment='尾部模板')


class XlxMember(Base):
    __tablename__ = 'xlx_member'
    __table_args__ = (
        Index('index_mobile', 'mobile', 'utype', unique=True),
        Index('index_username', 'username', 'utype', unique=True))

    uid = Column(INTEGER(10), primary_key=True)
    utype = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    mobile = Column(String(11), nullable=False)
    username = Column(String(30), nullable=False, server_default=text("''"))
    email = Column(String(30), nullable=False)
    password = Column(String(100), nullable=False, server_default=text("''"))
    pwd_hash = Column(String(30), nullable=False)
    reg_time = Column(INTEGER(10), nullable=False)
    reg_ip = Column(String(30), nullable=False)
    reg_address = Column(String(30), nullable=False)
    last_login_time = Column(INTEGER(10), nullable=False)
    last_login_ip = Column(String(30), nullable=False)
    last_login_address = Column(String(30), nullable=False)
    status = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    avatar = Column(String(255), nullable=False)
    robot = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    platform = Column(String(30), nullable=False, server_default=text("''"))
    nologin_notice_counter = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    disable_im = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='禁用职聊')
    openid = Column(String(255), comment='发送微信通知')
    points = relationship("XlxMemberPoints", back_populates="member")
    company = relationship("XlxCompany", back_populates="member")
    resume = relationship("XlxResume", back_populates="member")
    memberbind = relationship("XlxMemberBind", back_populates="member")


class XlxMemberActionLog(Base):
    __tablename__ = 'xlx_member_action_log'
    __table_args__ = (Index('index_content', 'content'), Index('uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    utype = Column(TINYINT(1), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    content = Column(String(100), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    ip = Column(String(30), nullable=False)
    ip_addr = Column(String(30), nullable=False)
    platform = Column(String(30), nullable=False, server_default=text("''"))
    is_login = Column(TINYINT(1), nullable=False)


class XlxMemberAppeal(Base):
    __tablename__ = 'xlx_member_appeal'

    id = Column(INTEGER(10), primary_key=True)
    realname = Column(String(30), nullable=False)
    mobile = Column(String(11), nullable=False)
    description = Column(String(255), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    status = Column(TINYINT(1), nullable=False)


class XlxMemberBind(Base):
    __tablename__ = 'xlx_member_bind'
    __table_args__ = (Index('index_uid', 'uid'),)

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), ForeignKey('xlx_member.uid'), nullable=False)
    type = Column(String(30), nullable=False)
    openid = Column(String(50), nullable=False)
    unionid = Column(String(50), nullable=False)
    nickname = Column(String(30), nullable=False)
    avatar = Column(String(255), nullable=False)
    bindtime = Column(INTEGER(10), nullable=False)
    is_subscribe = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    member = relationship("XlxMember", back_populates="memberbind")


class XlxMemberCancelApply(Base):
    __tablename__ = 'xlx_member_cancel_apply'

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    status = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    handlertime = Column(INTEGER(10), nullable=False)
    regtime = Column(String(30), nullable=False)
    companyname = Column(String(100), nullable=False)
    mobile = Column(String(11), nullable=False)
    contact = Column(String(30), nullable=False)
    utype = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='会员类型 1-企业 2-会员')
    is_backups = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否已备份 1-是 0-否')


class XlxMemberPoints(Base):
    __tablename__ = 'xlx_member_points'
    __table_args__ = (Index('index_uid', 'uid', unique=True),)

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), ForeignKey('xlx_member.uid'), nullable=False)
    points = Column(INTEGER(10), nullable=False)
    member = relationship("XlxMember", back_populates="points")


class XlxMemberPointsLog(Base):
    __tablename__ = 'xlx_member_points_log'
    __table_args__ = (Index('index_uid', 'uid'),)

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    op = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='1增加 2减少')
    points = Column(INTEGER(10), nullable=False)
    content = Column(String(255), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxMemberSetmeal(Base):
    __tablename__ = 'xlx_member_setmeal'
    __table_args__ = (Index('index_setmeal_id', 'setmeal_id'), Index('index_uid', 'uid', unique=True))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    expired = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    setmeal_id = Column(INTEGER(10), nullable=False)
    deadline = Column(INTEGER(10), nullable=False)
    download_resume_point = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    jobs_meanwhile = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    refresh_jobs_free_perday = Column(INTEGER(10), nullable=False)
    download_resume_max_perday = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    service_added_discount = Column(Float(2, True), nullable=False)
    enable_video_interview = Column(TINYINT(1), nullable=False)
    show_apply_contact = Column(TINYINT(1), nullable=False)
    im_max_perday = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='每天最多可发起聊天次数')
    im_total = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='一共可发起聊天次数')
    purchase_resume_point = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='购买增值简历包')
    resume_view_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='收到简历免费查看数')
    opening_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='套餐开通时间')
    im_added_package = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='职聊增值包次数')


class XlxMemberSetmealLog(Base):
    __tablename__ = 'xlx_member_setmeal_log'
    __table_args__ = (Index('index_uid', 'uid'),)

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    content = Column(String(255), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxMemberSetmealOpenLog(Base):
    __tablename__ = 'xlx_member_setmeal_open_log'
    __table_args__ = (Index('admin_id', 'admin_id'), Index('setmeal_id', 'setmeal_id'), Index('uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    setmeal_id = Column(INTEGER(10), nullable=False)
    setmeal_name = Column(String(30), nullable=False, comment='套餐名称')
    addtime = Column(INTEGER(10), nullable=False)
    type = Column(TINYINT(1), nullable=False, comment='开通方式 1注册赠送 2自主开通 3后台开通')
    type_cn = Column(String(30), nullable=False)
    order_id = Column(INTEGER(10), nullable=False, comment='订单id')
    admin_username = Column(String(30), nullable=False)
    admin_id = Column(INTEGER(10), nullable=False, comment='管理员id')


class XlxMessage(Base):
    __tablename__ = 'xlx_message'
    __table_args__ = (Index('index_id', 'id'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    type = Column(INTEGER(10), nullable=False)
    content = Column(Text, nullable=False)
    inner_link = Column(String(30), nullable=False)
    inner_link_params = Column(INTEGER(10), nullable=False)
    spe_link_params = Column(String(100), nullable=False, server_default=text("''"))
    addtime = Column(INTEGER(10), nullable=False)
    is_readed = Column(TINYINT(1), nullable=False)


class XlxMicroposteTpl(Base):
    __tablename__ = 'xlx_microposte_tpl'

    id = Column(INTEGER(10), primary_key=True)
    jobnum = Column(TINYINT(1), nullable=False)
    name = Column(String(30), nullable=False)
    thumb = Column(String(30), nullable=False)


class XlxMobileIndexMenu(Base):
    __tablename__ = 'xlx_mobile_index_menu'

    id = Column(INTEGER(10), primary_key=True)
    alias = Column(String(30), nullable=False)
    title = Column(String(30), nullable=False)
    custom_title = Column(String(30), nullable=False)
    icon = Column(INTEGER(10), nullable=False)
    link_url = Column(String(255), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)


class XlxMobileIndexModule(Base):
    __tablename__ = 'xlx_mobile_index_module'

    id = Column(INTEGER(10), primary_key=True)
    alias = Column(String(30), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    plan_id = Column(String(50), nullable=False)


class XlxNavigation(Base):
    __tablename__ = 'xlx_navigation'

    id = Column(INTEGER(10), primary_key=True)
    is_display = Column(TINYINT(1), nullable=False)
    title = Column(String(15), nullable=False)
    link_type = Column(TINYINT(1), nullable=False)
    page = Column(String(30), nullable=False)
    url = Column(String(200), nullable=False)
    target = Column(String(10), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)


class XlxNotice(Base):
    __tablename__ = 'xlx_notice'
    __table_args__ = (Index('index_sort_id_addtime', 'sort_id', 'addtime'),)

    id = Column(INTEGER(10), primary_key=True)
    title = Column(String(100), nullable=False)
    content = Column(LONGTEXT, nullable=False)
    attach = Column(Text, nullable=False)
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    link_url = Column(String(200), nullable=False, server_default=text("''"))
    seo_keywords = Column(String(100), nullable=False, server_default=text("''"))
    seo_description = Column(String(200), nullable=False, server_default=text("''"))
    click = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    addtime = Column(INTEGER(10), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    source = Column(TINYINT(4), nullable=False, server_default=text("'0'"), comment='来源:0|原创;1|转载')
    source_reprint = Column(String(50), nullable=False, server_default=text("''"), comment='转载来源')


class XlxNotifyLog(Base):
    __tablename__ = 'xlx_notify_log'
    __table_args__ = (Index('uid_time', 'uid', 'addtime'),)

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    alias = Column(String(30), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxNotifyRule(Base):
    __tablename__ = 'xlx_notify_rule'

    id = Column(INTEGER(10), primary_key=True)
    alias = Column(String(30), nullable=False)
    utype = Column(TINYINT(1), nullable=False)
    type = Column(INTEGER(10), nullable=False)
    title = Column(String(30), nullable=False)
    content = Column(Text, nullable=False)
    inner_link = Column(String(30), nullable=False)
    open_message = Column(TINYINT(1), nullable=False)
    open_sms = Column(TINYINT(1), nullable=False)
    open_email = Column(TINYINT(1), nullable=False)
    open_push = Column(TINYINT(1), nullable=False)
    max_time_per_day = Column(INTEGER(10), nullable=False)

    def to_dict(self):
        return {'id': self.id, 'alias': self.alias, 'utype': self.utype, 'type': self.type, 'title': self.title,
                'content': self.content,
                'inner_link': self.inner_link, 'open_message': self.open_message, 'open_sms': self.open_sms,
                'open_email': self.open_email,
                'open_push': self.open_push, 'max_time_per_day': self.max_time_per_day}


class XlxOrder(Base):
    __tablename__ = 'xlx_order'

    id = Column(INTEGER(10), primary_key=True)
    utype = Column(TINYINT(1), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    oid = Column(String(50), nullable=False)
    service_type = Column(String(30), nullable=False)
    service_name = Column(String(30), nullable=False)
    amount = Column(DECIMAL(10, 2), nullable=False, comment='最终支付金额')
    service_amount = Column(DECIMAL(10, 2), nullable=False, comment='服务价格')
    service_amount_after_discount = Column(DECIMAL(10, 2), nullable=False, comment='折后价格')
    deduct_amount = Column(DECIMAL(10, 2), nullable=False, comment='抵扣掉的金额')
    deduct_points = Column(INTEGER(10), nullable=False, comment='抵扣积分数')
    payment = Column(String(20), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    paytime = Column(INTEGER(10), nullable=False)
    status = Column(TINYINT(1), nullable=False)
    extra = Column(Text, nullable=False)
    note = Column(String(200), nullable=False)
    add_platform = Column(String(30), nullable=False, server_default=text("''"))
    pay_platform = Column(String(30), nullable=False, server_default=text("''"))
    service_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    return_url = Column(String(255), nullable=False)
    deadline = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class XlxOrderTmp(Base):
    __tablename__ = 'xlx_order_tmp'

    id = Column(INTEGER(10), primary_key=True)
    utype = Column(TINYINT(1), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    oid = Column(String(50), nullable=False)
    service_type = Column(String(30), nullable=False)
    service_name = Column(String(30), nullable=False)
    amount = Column(DECIMAL(10, 2), nullable=False, comment='最终支付金额')
    service_amount = Column(DECIMAL(10, 2), nullable=False, comment='服务价格')
    service_amount_after_discount = Column(DECIMAL(10, 2), nullable=False, comment='折后价格')
    deduct_amount = Column(DECIMAL(10, 2), nullable=False, comment='抵扣掉的金额')
    deduct_points = Column(INTEGER(10), nullable=False, comment='抵扣积分数')
    payment = Column(String(20), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    paytime = Column(INTEGER(10), nullable=False)
    status = Column(TINYINT(1), nullable=False)
    extra = Column(Text, nullable=False)
    note = Column(String(200), nullable=False)
    add_platform = Column(String(30), nullable=False, server_default=text("''"))
    pay_platform = Column(String(30), nullable=False, server_default=text("''"))
    service_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    return_url = Column(String(255), nullable=False)
    deadline = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class XlxOutbountSeats(Base):
    __tablename__ = 'xlx_outbount_seats'
    __table_args__ = {'comment': '外呼坐席绑定表'}

    id = Column(INTEGER(10), primary_key=True, comment='主键ID')
    seat_id = Column(INTEGER(10), nullable=False, comment='坐席ID')
    seat_number = Column(CHAR(8, 'utf8mb4_unicode_ci'), nullable=False, comment='坐席编号')
    admin_id = Column(INTEGER(10), nullable=False, comment='坐席员工id')
    bind_time = Column(INTEGER(10), nullable=False, comment='绑定时间')


class XlxPage(Base):
    __tablename__ = 'xlx_page'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    alias = Column(String(30), nullable=False)
    enable_cache = Column(TINYINT(1), nullable=False)
    expire = Column(INTEGER(10), nullable=False)
    seo_title = Column(String(100), nullable=False)
    seo_keywords = Column(String(100), nullable=False)
    seo_description = Column(String(200), nullable=False)
    params = Column(Text, nullable=False)


class XlxPageMobile(Base):
    __tablename__ = 'xlx_page_mobile'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    alias = Column(String(30), nullable=False)
    enable_cache = Column(TINYINT(1), nullable=False)
    expire = Column(INTEGER(10), nullable=False)
    seo_title = Column(String(100), nullable=False)
    seo_keywords = Column(String(100), nullable=False)
    seo_description = Column(String(200), nullable=False)
    params = Column(Text, nullable=False)


class XlxPersonCancelApplyBackups(Base):
    __tablename__ = 'xlx_person_cancel_apply_backups'
    __table_args__ = {'comment': '个人注销备份'}

    id = Column(INTEGER(10), primary_key=True)
    cancel_apply_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='注销申请id')
    uid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='uid')
    rid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='简历id')
    mobile = Column(CHAR(11, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='会员联系方式')
    fullname = Column(String(15, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='简历名称')
    contact_mobile = Column(CHAR(11, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"),
                            comment='简历联系人电话')
    addtime = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='简历添加时间')
    reg_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='注册时间')
    cancel_apply_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='注销申请时间')
    create_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='添加时间')
    education = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='学历id')
    education_name = Column(String(50, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"),
                            comment='学历名称')
    enter_job_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='参加工作时间')
    delivery_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='投递数')
    download_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='被下载数')
    viewed_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='被查看数')
    invitation_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='被邀请数')
    content = Column(Text(collation='utf8mb4_unicode_ci'), comment='备份内容')


class XlxPersonalServiceStick(Base):
    __tablename__ = 'xlx_personal_service_stick'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    recommend = Column(TINYINT(1), nullable=False)
    days = Column(INTEGER(10), nullable=False)
    expense = Column(DECIMAL(10, 2), nullable=False)
    enable_points_deduct = Column(TINYINT(1), nullable=False)
    deduct_max = Column(DECIMAL(10, 2), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)


class XlxPersonalServiceTag(Base):
    __tablename__ = 'xlx_personal_service_tag'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    recommend = Column(TINYINT(1), nullable=False)
    days = Column(INTEGER(10), nullable=False)
    expense = Column(DECIMAL(10, 2), nullable=False)
    enable_points_deduct = Column(TINYINT(1), nullable=False)
    deduct_max = Column(DECIMAL(10, 2), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)


class XlxPoster(Base):
    __tablename__ = 'xlx_poster'

    id = Column(INTEGER(10), primary_key=True)
    indexid = Column(INTEGER(10), nullable=False)
    type = Column(TINYINT(1), nullable=False, comment='1职位 2简历 3企业')
    name = Column(String(30), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)


class XlxRefreshJobLog(Base):
    __tablename__ = 'xlx_refresh_job_log'

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    jobid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    platform = Column(String(30), nullable=False, server_default=text("''"))
    source = Column(TINYINT(1), nullable=False, server_default=text("'1'"),
                    comment='刷新类型[1:后台系统刷新;2:免费刷新;3:公众号一键刷新;4:智能刷新;5:快捷支付]')


class XlxRefreshResumeLog(Base):
    __tablename__ = 'xlx_refresh_resume_log'

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    platform = Column(String(30), nullable=False, server_default=text("''"))


class XlxRefreshjobQueue(Base):
    __tablename__ = 'xlx_refreshjob_queue'

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    jobid = Column(INTEGER(10), nullable=False)
    execute_time = Column(INTEGER(10), nullable=False)


class XlxResume(Base):
    __tablename__ = 'xlx_resume'
    __table_args__ = (
        Index('index_addtime', 'addtime'), Index('index_audit', 'audit'), Index('index_refreshtime', 'refreshtime'),
        Index('index_uid', 'uid', unique=True))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), ForeignKey('xlx_member.uid'), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    high_quality = Column(TINYINT(1), nullable=False)
    display_name = Column(TINYINT(1), nullable=False)
    audit = Column(TINYINT(1), nullable=False)
    stick = Column(TINYINT(1), nullable=False)
    service_tag = Column(String(15), nullable=False, server_default=text("''"))
    fullname = Column(String(15), nullable=False)
    sex = Column(TINYINT(1), nullable=False)
    birthday = Column(String(15), nullable=False)
    residence = Column(String(30), nullable=False, server_default=text("''"))
    height = Column(String(5), nullable=False)
    marriage = Column(TINYINT(1), nullable=False)
    education = Column(INTEGER(10), nullable=False)
    enter_job_time = Column(INTEGER(10), nullable=False)
    householdaddress = Column(String(30), nullable=False, server_default=text("''"))
    major1 = Column(INTEGER(10), nullable=False)
    major2 = Column(INTEGER(10), nullable=False)
    major = Column(INTEGER(10), nullable=False)
    tag = Column(String(100), nullable=False)
    idcard = Column(String(18), nullable=False)
    specialty = Column(Text, nullable=False)
    photo_img = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    refreshtime = Column(INTEGER(10), nullable=False)
    updatetime = Column(INTEGER(10), nullable=False, comment='更新时间')
    current = Column(INTEGER(10), nullable=False)
    click = Column(INTEGER(10), nullable=False, server_default=text("'1'"))
    tpl = Column(String(30), nullable=False)
    custom_field_1 = Column(String(255), nullable=False, server_default=text("''"))
    custom_field_2 = Column(String(255), nullable=False, server_default=text("''"))
    custom_field_3 = Column(String(255), nullable=False, server_default=text("''"))
    platform = Column(String(30), nullable=False, server_default=text("''"))
    remark = Column(String(200), nullable=False, server_default=text("''"))
    comment = Column(String(200), nullable=False, server_default=text("''"))
    last_visit_time = Column(INTEGER(11), server_default=text("'0'"), comment='最后跟进时间')
    last_visit_admin = Column(INTEGER(11), server_default=text("'0'"), comment='最后跟进人')
    is_status_weixin = Column(TINYINT(1), server_default=text("'1'"), comment='联系状态微信:1=未联系,2=已联系')
    is_status_phone = Column(TINYINT(1), server_default=text("'1'"), comment='联系状态电话:1=未联系,2=已联系')
    member = relationship("XlxMember", back_populates="resume")


class XlxResumeAnalysisLog(Base):
    __tablename__ = 'xlx_resume_analysis_log'
    __table_args__ = (Index('index_fid', 'file_id'), Index('index_rid', 'request_id'), Index('index_uid', 'uid'),
                      {'comment': '简历解析日志'})

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='会员UID')
    file_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='附件简历ID')
    request_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='简历解析任务ID')
    code = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='解析结果CODE')
    result = Column(Text(collation='utf8mb4_unicode_ci'), nullable=False, comment='解析结果MESSAGE')
    addtime = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='创建时间')
    notify = Column(Text(collation='utf8mb4_unicode_ci'), comment='回调结果')


class XlxResumeAuditLog(Base):
    __tablename__ = 'xlx_resume_audit_log'

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    resumeid = Column(INTEGER(10), nullable=False)
    audit = Column(TINYINT(1), nullable=False)
    reason = Column(String(200), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxResumeCertificate(Base):
    __tablename__ = 'xlx_resume_certificate'
    __table_args__ = (Index('index_rid_uid', 'rid', 'uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    rid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    name = Column(String(30), nullable=False)
    obtaintime = Column(INTEGER(10), nullable=False)


class XlxResumeComplete(Base):
    __tablename__ = 'xlx_resume_complete'
    __table_args__ = (Index('index_rid_uid', 'rid', 'uid', unique=True), Index('index_uid', 'uid', unique=True))

    id = Column(INTEGER(10), primary_key=True)
    rid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    basic = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    intention = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    specialty = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    education = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    work = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    training = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    project = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    certificate = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    language = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    tag = Column(TINYINT(1), nullable=False, server_default=text("'0'"))
    img = Column(TINYINT(1), nullable=False, server_default=text("'0'"))


class XlxResumeContact(Base):
    __tablename__ = 'xlx_resume_contact'
    __table_args__ = (Index('index_rid_uid', 'rid', 'uid', unique=True), Index('index_uid', 'uid', unique=True))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    rid = Column(INTEGER(10), nullable=False)
    mobile = Column(String(11), nullable=False)
    email = Column(String(30), nullable=False, server_default=text("''"))
    qq = Column(String(30), nullable=False, server_default=text("''"))
    weixin = Column(String(30), nullable=False, server_default=text("''"))


class XlxResumeEducation(Base):
    __tablename__ = 'xlx_resume_education'
    __table_args__ = (Index('index_rid_uid', 'rid', 'uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    rid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    starttime = Column(INTEGER(10), nullable=False)
    endtime = Column(INTEGER(10), nullable=False)
    todate = Column(INTEGER(10), nullable=False)
    school = Column(String(30), nullable=False)
    major = Column(String(20), nullable=False)
    education = Column(INTEGER(10), nullable=False)


class XlxResumeEnclosure(Base):
    __tablename__ = 'xlx_resume_enclosure'
    __table_args__ = (Index('index_rid_uid', 'rid', 'uid'), Index('index_uid', 'uid'), {'comment': '简历-附件简历'})

    id = Column(INTEGER(10), primary_key=True, comment='主键ID')
    rid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='简历ID')
    uid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='会员ID')
    enclosure = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='附件简历ID')
    title = Column(String(255, 'utf8mb4_unicode_ci'), nullable=False, server_default=text("''"), comment='名称')
    addtime = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    audit = Column(TINYINT(1), nullable=False, server_default=text("'1'"))


class XlxResumeExpect(Base):
    __tablename__ = 'xlx_resume_expect'
    __table_args__ = (Index('idx_rid', 'rid'), Index('idx_trade', 'trade'), Index('idx_uid', 'uid'),
                      Index('idx_wage', 'minwage', 'maxwage'), {'comment': '简历求职意向表（新）'})

    id = Column(INTEGER(10), primary_key=True)
    rid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='简历ID')
    uid = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='会员UID')
    nature = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='工作性质')
    minwage = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最低薪资')
    maxwage = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='最高薪资')
    trade = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='期望行业')
    category = Column(String(100), nullable=False, server_default=text("''"), comment='实际选中的职位分类')
    district = Column(String(100), nullable=False, server_default=text("''"), comment='实际选中的地区')


t_xlx_resume_expect_category = Table('xlx_resume_expect_category',
                                     metadata,
                                     Column('rid', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='简历ID'),
                                     Column('uid', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='会员UID'),
                                     Column('category1', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='职位分类1级'),
                                     Column('category2', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='职位分类2级'),
                                     Column('category3', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='职位分类3级'),
                                     Column('category', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='职位分类最后一级'),
                                     Index('idx_category', 'category'),
                                     Index('idx_rid', 'rid'),
                                     Index('idx_uid', 'uid'),
                                     comment='简历求职意向—职位分类表')

t_xlx_resume_expect_district = Table('xlx_resume_expect_district',
                                     metadata,
                                     Column('rid', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='简历ID'),
                                     Column('uid', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='会员UID'),
                                     Column('district1', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='地区分类1级'),
                                     Column('district2', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='地区分类2级'),
                                     Column('district3', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='地区分类3级'),
                                     Column('district', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='地区分类最后一级'),
                                     Index('idx_district', 'district'),
                                     Index('idx_rid', 'rid'),
                                     Index('idx_uid', 'uid'),
                                     comment='简历求职意向—地区分类表')


class XlxResumeImg(Base):
    __tablename__ = 'xlx_resume_img'
    __table_args__ = (Index('index_rid_uid', 'rid', 'uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    rid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    img = Column(INTEGER(10), nullable=False)
    title = Column(String(20), nullable=False, server_default=text("''"))
    addtime = Column(INTEGER(10), nullable=False)
    audit = Column(TINYINT(1), nullable=False)


class XlxResumeIntention(Base):
    __tablename__ = 'xlx_resume_intention'
    __table_args__ = (
        Index('index_category', 'category'), Index('index_category1', 'category1'), Index('index_district', 'district'),
        Index('index_rid_uid', 'rid',
              'uid'), Index('index_trade', 'trade'), Index('index_uid',
                                                           'uid'), Index('index_wage', 'minwage', 'maxwage'))

    id = Column(INTEGER(10), primary_key=True)
    rid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    nature = Column(INTEGER(10), nullable=False)
    category1 = Column(INTEGER(10), nullable=False)
    category2 = Column(INTEGER(10), nullable=False)
    category3 = Column(INTEGER(10), nullable=False)
    category = Column(INTEGER(10), nullable=False)
    district1 = Column(INTEGER(10), nullable=False)
    district2 = Column(INTEGER(10), nullable=False)
    district3 = Column(INTEGER(10), nullable=False)
    district = Column(INTEGER(10), nullable=False)
    minwage = Column(INTEGER(10), nullable=False)
    maxwage = Column(INTEGER(10), nullable=False)
    trade = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    is_sync = Column(TINYINT(1), nullable=False, server_default=text("'0'"))


class XlxResumeLanguage(Base):
    __tablename__ = 'xlx_resume_language'
    __table_args__ = (Index('index_rid_uid', 'rid', 'uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    rid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    language = Column(INTEGER(10), nullable=False)
    level = Column(INTEGER(10), nullable=False)


class XlxResumeModule(Base):
    __tablename__ = 'xlx_resume_module'
    __table_args__ = (Index('index_module_name', 'module_name', unique=True),)

    id = Column(INTEGER(10), primary_key=True)
    module_name = Column(String(30), nullable=False)
    module_cn = Column(String(30), nullable=False)
    score = Column(INTEGER(10), nullable=False)
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    enable_close = Column(TINYINT(1), nullable=False, server_default=text("'0'"))


class XlxResumeProject(Base):
    __tablename__ = 'xlx_resume_project'
    __table_args__ = (Index('index_rid_uid', 'rid', 'uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    rid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    starttime = Column(INTEGER(10), nullable=False)
    endtime = Column(INTEGER(10), nullable=False)
    todate = Column(INTEGER(10), nullable=False)
    projectname = Column(String(30), nullable=False)
    role = Column(String(30), nullable=False)
    description = Column(Text, nullable=False)


class XlxResumeRemark(Base):
    __tablename__ = 'xlx_resume_remark'
    __table_args__ = (Index('idx_comid', 'comid'), Index('idx_comid_resumeid', 'comid', 'resume_id', unique=True),
                      Index('idx_resumeid', 'resume_id'), {'comment': '企业-简历备注表'})

    id = Column(INTEGER(10), primary_key=True, comment='主键自增ID')
    comid = Column(INTEGER(10), nullable=False, comment='企业ID')
    resume_id = Column(INTEGER(10), nullable=False, comment='简历ID')
    remark = Column(String(50, 'utf8mb4_general_ci'), nullable=False, comment='备注')
    addtime = Column(INTEGER(10), nullable=False, comment='创建时间')
    updatetime = Column(INTEGER(10), nullable=False, comment='更新时间')


class XlxResumeSearchKey(Base):
    __tablename__ = 'xlx_resume_search_key'
    __table_args__ = (
        Index('index_fulltext_index', 'intention_jobs', 'fulltext_key'),
        Index('index_intention_jobs', 'intention_jobs'),
        Index('index_uid', 'uid', unique=True))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    high_quality = Column(TINYINT(1), nullable=False)
    photo = Column(TINYINT(1), nullable=False)
    stick = Column(TINYINT(1), nullable=False)
    sex = Column(TINYINT(1), nullable=False)
    birthyear = Column(SMALLINT(4), nullable=False)
    education = Column(INTEGER(10), nullable=False)
    enter_job_time = Column(INTEGER(10), nullable=False)
    major1 = Column(INTEGER(10), nullable=False)
    major2 = Column(INTEGER(10), nullable=False)
    major = Column(INTEGER(10), nullable=False)
    tag = Column(String(50), nullable=False)
    intention_jobs = Column(String(255), nullable=False)
    fulltext_key = Column(Text, nullable=False)
    refreshtime = Column(INTEGER(10), nullable=False)


class XlxResumeSearchRtime(Base):
    __tablename__ = 'xlx_resume_search_rtime'
    __table_args__ = (Index('index_rtime', 'refreshtime'), Index('index_stick_rtime', 'stick', 'refreshtime'),
                      Index('index_uid', 'uid', unique=True))

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    high_quality = Column(TINYINT(1), nullable=False)
    photo = Column(TINYINT(1), nullable=False)
    stick = Column(TINYINT(1), nullable=False)
    sex = Column(TINYINT(1), nullable=False)
    birthyear = Column(SMALLINT(4), nullable=False)
    education = Column(INTEGER(10), nullable=False)
    enter_job_time = Column(INTEGER(10), nullable=False)
    major1 = Column(INTEGER(10), nullable=False)
    major2 = Column(INTEGER(10), nullable=False)
    major = Column(INTEGER(10), nullable=False)
    tag = Column(String(50), nullable=False)
    refreshtime = Column(INTEGER(10), nullable=False)


class XlxResumeTraining(Base):
    __tablename__ = 'xlx_resume_training'
    __table_args__ = (Index('index_rid_uid', 'rid', 'uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    rid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    starttime = Column(INTEGER(10), nullable=False)
    endtime = Column(INTEGER(10), nullable=False)
    todate = Column(INTEGER(10), nullable=False)
    agency = Column(String(30), nullable=False)
    course = Column(String(30), nullable=False)
    description = Column(Text, nullable=False)


class XlxResumeWork(Base):
    __tablename__ = 'xlx_resume_work'
    __table_args__ = (Index('index_rid_uid', 'rid', 'uid'), Index('index_uid', 'uid'))

    id = Column(INTEGER(10), primary_key=True)
    rid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    starttime = Column(INTEGER(10), nullable=False)
    endtime = Column(INTEGER(10), nullable=False)
    todate = Column(INTEGER(10), nullable=False)
    companyname = Column(String(30), nullable=False)
    jobname = Column(String(30), nullable=False)
    duty = Column(Text, nullable=False)


class XlxSceneQrcode(Base):
    __tablename__ = 'xlx_scene_qrcode'
    __table_args__ = (Index('uuid', 'uuid', unique=True),)

    id = Column(INTEGER(10), primary_key=True)
    uuid = Column(String(32), nullable=False)
    title = Column(String(30), nullable=False)
    type = Column(String(30), nullable=False)
    deadline = Column(INTEGER(10), nullable=False)
    platform = Column(TINYINT(1), nullable=False)
    paramid = Column(INTEGER(10), nullable=False)
    qrcode_src = Column(String(255), nullable=False)


class XlxSceneQrcodeRegLog(Base):
    __tablename__ = 'xlx_scene_qrcode_reg_log'
    __table_args__ = (Index('pid', 'pid'),)

    id = Column(INTEGER(10), primary_key=True)
    pid = Column(INTEGER(10), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxSceneQrcodeScanLog(Base):
    __tablename__ = 'xlx_scene_qrcode_scan_log'
    __table_args__ = (Index('pid', 'pid'),)

    id = Column(INTEGER(10), primary_key=True)
    pid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxSceneQrcodeSubscribeLog(Base):
    __tablename__ = 'xlx_scene_qrcode_subscribe_log'
    __table_args__ = (Index('pid', 'pid'),)

    id = Column(INTEGER(10), primary_key=True)
    pid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxServiceOl(Base):
    __tablename__ = 'xlx_service_ol'

    id = Column(INTEGER(10), primary_key=True, comment='id')
    name = Column(String(15), nullable=False, comment='姓名')
    mobile = Column(String(20), nullable=False, comment='手机')
    weixin = Column(INTEGER(10), nullable=False, comment='微信图片')
    qq = Column(String(30), nullable=False, comment='QQ')
    sort = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='排序')
    display = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否显示')


class XlxServiceQueue(Base):
    __tablename__ = 'xlx_service_queue'

    id = Column(INTEGER(10), primary_key=True)
    type = Column(String(30), nullable=False)
    utype = Column(TINYINT(1), nullable=False)
    pid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    deadline = Column(INTEGER(10), nullable=False)


class XlxSetmeal(Base):
    __tablename__ = 'xlx_setmeal'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30), nullable=False)
    icon = Column(INTEGER(10), nullable=False)
    expense = Column(DECIMAL(10, 2), nullable=False)
    days = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    preferential_open = Column(TINYINT(1), nullable=False)
    preferential_expense = Column(DECIMAL(10, 2), nullable=False)
    preferential_expense_start = Column(INTEGER(10), nullable=False)
    preferential_expense_end = Column(INTEGER(10), nullable=False)
    download_resume_point = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    gift_point = Column(INTEGER(10), nullable=False)
    jobs_meanwhile = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    refresh_jobs_free_perday = Column(INTEGER(10), nullable=False)
    download_resume_max_perday = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    service_added_discount = Column(Float(2, True), nullable=False)
    enable_video_interview = Column(TINYINT(1), nullable=False)
    show_apply_contact = Column(TINYINT(1), nullable=False)
    note = Column(String(100), nullable=False)
    recommend = Column(TINYINT(1), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"))
    is_apply = Column(TINYINT(1), nullable=False)
    im_max_perday = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    im_total = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    resume_view_num = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='收到简历免费查看数')


class XlxShield(Base):
    __tablename__ = 'xlx_shield'
    __table_args__ = (Index('company_uid', 'company_uid'), Index('personal_uid', 'personal_uid'))

    id = Column(INTEGER(10), primary_key=True)
    company_uid = Column(INTEGER(10), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)


class XlxShortUrl(Base):
    __tablename__ = 'xlx_short_url'
    __table_args__ = (Index('code_endtime', 'code', 'endtime'), {'comment': '短链接表'})

    id = Column(INTEGER(11), primary_key=True)
    url = Column(String(125), nullable=False, server_default=text("''"), comment='原始链接')
    code = Column(VARBINARY(5), nullable=False, server_default=text("''"), comment='短码')
    addtime = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='创建时间')
    endtime = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='截止时间')
    pv = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='点击量')
    admin_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='建创者id')
    remark = Column(String(50), nullable=False, server_default=text("''"), comment='备注')


class XlxSmsBlacklist(Base):
    __tablename__ = 'xlx_sms_blacklist'
    __table_args__ = (Index('mobile', 'mobile'),)

    id = Column(INTEGER(10), primary_key=True)
    mobile = Column(String(11), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    note = Column(String(100), nullable=False)


class XlxSmsTpl(Base):
    __tablename__ = 'xlx_sms_tpl'

    id = Column(INTEGER(10), primary_key=True)
    title = Column(String(30), nullable=False)
    code = Column(String(30), nullable=False)
    alisms_tplcode = Column(String(30), nullable=False)
    params = Column(String(100), nullable=False)
    content = Column(String(100), nullable=False)


class XlxStatViewJob(Base):
    __tablename__ = 'xlx_stat_view_job'
    __table_args__ = (Index('index_comuid_jobid', 'company_uid', 'jobid'),
                      Index('index_peruid_jobid_time', 'personal_uid', 'jobid', 'addtime'))

    id = Column(INTEGER(10), primary_key=True)
    company_uid = Column(INTEGER(10), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)
    jobid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxSubscribeJob(Base):
    __tablename__ = 'xlx_subscribe_job'

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    category1 = Column(INTEGER(10), nullable=False)
    category2 = Column(INTEGER(10), nullable=False)
    category3 = Column(INTEGER(10), nullable=False)
    category = Column(String(255), nullable=False)
    district1 = Column(INTEGER(10), nullable=False)
    district2 = Column(INTEGER(10), nullable=False)
    district3 = Column(INTEGER(10), nullable=False)
    district = Column(String(255), nullable=False)
    minwage = Column(INTEGER(10), nullable=False)
    maxwage = Column(INTEGER(10), nullable=False)
    pushtime = Column(INTEGER(10), nullable=False)


t_xlx_subscribe_job_category = Table('xlx_subscribe_job_category',
                                     metadata,
                                     Column('uid', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='会员UID'),
                                     Column('category1', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='职位分类1级'),
                                     Column('category2', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='职位分类2级'),
                                     Column('category3', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='职位分类3级'),
                                     Column('category', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='职位分类最后一级'),
                                     Index('idx_category', 'category'),
                                     Index('idx_uid', 'uid'),
                                     comment='订阅职位—职位分类表')

t_xlx_subscribe_job_district = Table('xlx_subscribe_job_district',
                                     metadata,
                                     Column('uid', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='会员UID'),
                                     Column('district1', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='地区分类1级'),
                                     Column('district2', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='地区分类2级'),
                                     Column('district3', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='地区分类3级'),
                                     Column('district', INTEGER(10), nullable=False, server_default=text("'0'"),
                                            comment='地区分类最后一级'),
                                     Index('idx_district', 'district'),
                                     Index('idx_uid', 'uid'),
                                     comment='订阅职位—地区分类表')


class XlxSubsite(Base):
    __tablename__ = 'xlx_subsite'

    id = Column(INTEGER(10), primary_key=True)
    sitename = Column(String(30), nullable=False)
    district1 = Column(INTEGER(10), nullable=False)
    district2 = Column(INTEGER(10), nullable=False)
    district3 = Column(INTEGER(10), nullable=False)
    district = Column(INTEGER(10), nullable=False)
    title = Column(String(100), nullable=False)
    keywords = Column(String(100), nullable=False)
    description = Column(String(200), nullable=False)
    tpl = Column(String(30), nullable=False)
    is_display = Column(TINYINT(1), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False)
    initial = Column(CHAR(1), nullable=False, server_default=text("''"), comment='分站首字母')
    url_type = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='URL类型:1|二级域名;2:|首页目录')
    second_domain = Column(String(255), nullable=False, server_default=text("''"), comment='绑定域名')
    directory = Column(String(255), nullable=False, server_default=text("''"), comment='分站目录')


class XlxSvAd(Base):
    __tablename__ = 'xlx_sv_ad'
    __table_args__ = {'comment': '视频招聘广告表'}

    id = Column(INTEGER(10), primary_key=True)
    is_display = Column(TINYINT(1), nullable=False, server_default=text("'1'"), comment='是否显示')
    cid = Column(INTEGER(10), nullable=False, comment='分类id')
    title = Column(String(100), nullable=False, comment='标题')
    imageid = Column(INTEGER(10), nullable=False, comment='图片id')
    imageurl = Column(String(255), nullable=False, comment='图片地址')
    explain = Column(String(255), nullable=False, comment='图片文字说明 ')
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='排序')
    starttime = Column(INTEGER(10), nullable=False, comment='开始时间')
    deadline = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='结束时间')
    target = Column(TINYINT(1), nullable=False, comment='跳转链接类型')
    link_url = Column(String(255), nullable=False, comment='跳转地址')
    inner_link = Column(String(30), nullable=False, comment='跳转内链地址')
    inner_link_params = Column(INTEGER(10), nullable=False, comment='跳转内链参数')
    company_id = Column(INTEGER(10), nullable=False, comment='企业id')
    addtime = Column(INTEGER(10), nullable=False, comment='添加时间')


class XlxSvAdCategory(Base):
    __tablename__ = 'xlx_sv_ad_category'
    __table_args__ = {'comment': '视频招聘广告分类表'}

    id = Column(INTEGER(10), primary_key=True)
    alias = Column(String(50), nullable=False, comment='调用名称')
    name = Column(String(100), nullable=False, comment='广告位名称')
    width = Column(INTEGER(10), nullable=False, comment='建议宽度')
    height = Column(INTEGER(10), nullable=False, comment='建议高度')
    ad_num = Column(INTEGER(10), nullable=False, comment='广告数量')
    is_sys = Column(TINYINT(1), nullable=False, server_default=text("'0'"), comment='是否是系统自带，1是，0否')
    platform = Column(String(30), nullable=False, comment='所属平台')


class XlxSvCollect(Base):
    __tablename__ = 'xlx_sv_collect'
    __table_args__ = (Index('uid_type_vid', 'uid', 'type', 'vid'), {'comment': '赞记录表'})

    id = Column(INTEGER(11), primary_key=True)
    uid = Column(INTEGER(11), nullable=False)
    vid = Column(INTEGER(11), nullable=False, comment='视频id')
    type = Column(TINYINT(4), nullable=False, comment='视频类型,1企业,2个人')
    addtime = Column(INTEGER(11), nullable=False, comment='添加时间')


class XlxSvCompanyVideo(Base):
    __tablename__ = 'xlx_sv_company_video'
    __table_args__ = (
        Index('addtime', 'addtime'), Index('title', 'title'), Index('uid', 'uid'), Index('view_count', 'view_count'),
        {'comment': '企业视频表'})

    id = Column(INTEGER(11), primary_key=True, comment='id<10万是未审核,')
    is_public = Column(TINYINT(4), nullable=False, server_default=text("'2'"), comment='1不公开，2公开')
    audit = Column(TINYINT(4), nullable=False, server_default=text("'1'"), comment='1未审核,2审核通过,3审核失败')
    uid = Column(INTEGER(11), nullable=False)
    title = Column(String(100), nullable=False, server_default=text("''"), comment='标题')
    filesize = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='视频大小')
    fid = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='文件id')
    view_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='浏览量')
    lon = Column(Float(asdecimal=True), nullable=False, server_default=text("'0'"), comment='经度')
    lat = Column(Float(asdecimal=True), nullable=False, server_default=text("'0'"), comment='纬度')
    address = Column(String(30), nullable=False, server_default=text("''"), comment='当前地址')
    like = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='赞的数量')
    real_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"))
    reason = Column(String(50), nullable=False, server_default=text("''"), comment='审核未通过理由')
    addtime = Column(INTEGER(11), nullable=False, comment='添加时间')
    updatetime = Column(INTEGER(11), nullable=False, comment='修改时间')


class XlxSvPersonalVideo(Base):
    __tablename__ = 'xlx_sv_personal_video'
    __table_args__ = (
        Index('addtime', 'addtime'), Index('title', 'title'), Index('uid', 'uid'), Index('view_count', 'view_count'),
        {'comment': '个人视频表'})

    id = Column(INTEGER(11), primary_key=True, comment='id<10万是未审核,')
    is_public = Column(TINYINT(4), nullable=False, server_default=text("'2'"), comment='1不公开，2公开')
    audit = Column(TINYINT(4), nullable=False, server_default=text("'1'"), comment='1未审核,2审核通过,3审核失败')
    uid = Column(INTEGER(11), nullable=False)
    title = Column(String(100), nullable=False, server_default=text("''"), comment='标题')
    filesize = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='视频大小')
    fid = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='文件id')
    view_count = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='浏览量')
    lon = Column(Float(asdecimal=True), nullable=False, server_default=text("'0'"), comment='经度')
    lat = Column(Float(asdecimal=True), nullable=False, server_default=text("'0'"), comment='纬度')
    address = Column(String(30), nullable=False, server_default=text("''"), comment='当前地址')
    like = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='赞的数量')
    real_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"))
    reason = Column(String(50), nullable=False, server_default=text("''"), comment='审核未通过理由')
    addtime = Column(INTEGER(11), nullable=False, comment='添加时间')
    updatetime = Column(INTEGER(11), nullable=False, comment='修改时间')


class XlxTask(Base):
    __tablename__ = 'xlx_task'

    id = Column(INTEGER(10), primary_key=True)
    utype = Column(TINYINT(1), nullable=False)
    alias = Column(String(30), nullable=False)
    name = Column(String(30), nullable=False)
    points = Column(INTEGER(10), nullable=False)
    daily = Column(TINYINT(1), nullable=False)
    max_perday = Column(INTEGER(10), nullable=False)


class XlxTaskRecord(Base):
    __tablename__ = 'xlx_task_record'
    __table_args__ = (Index('uid', 'uid'),)

    id = Column(INTEGER(10), primary_key=True)
    uid = Column(INTEGER(10), nullable=False)
    alias = Column(String(30), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    points = Column(INTEGER(10), nullable=False)
    note = Column(String(30), nullable=True)


class XlxTipoff(Base):
    __tablename__ = 'xlx_tipoff'

    id = Column(INTEGER(10), primary_key=True)
    target_id = Column(INTEGER(10), nullable=False)
    type = Column(TINYINT(1), nullable=False)
    uid = Column(INTEGER(10), nullable=False)
    reason = Column(TINYINT(1), nullable=False)
    content = Column(String(255), nullable=False)
    img = Column(String(200), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)
    status = Column(TINYINT(1), nullable=False)


class XlxTpl(Base):
    __tablename__ = 'xlx_tpl'

    id = Column(INTEGER(10), primary_key=True)
    title = Column(String(30), nullable=False)
    alias = Column(String(30), nullable=False)
    type = Column(String(30), nullable=False)


class XlxTweetsLabel(Base):
    __tablename__ = 'xlx_tweets_label'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(100), nullable=False)
    value = Column(Text, nullable=False)
    type = Column(TINYINT(3), nullable=False, server_default=text("'2'"), comment='1-头部底部；2-主体')


class XlxTweetsTemplate(Base):
    __tablename__ = 'xlx_tweets_template'

    id = Column(INTEGER(11), primary_key=True)
    temname = Column(String(255), nullable=False)
    title = Column(Text, nullable=False)
    content = Column(Text, nullable=False)
    footer = Column(Text, nullable=False)
    addtime = Column(INTEGER(10))
    is_sys = Column(TINYINT(3), server_default=text("'0'"))


class XlxUploadfile(Base):
    __tablename__ = 'xlx_uploadfile'

    id = Column(INTEGER(10), primary_key=True)
    save_path = Column(String(255), nullable=False)
    platform = Column(String(20), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxUrmBackUp(Base):
    __tablename__ = 'xlx_urm_back_up'
    __table_args__ = {'comment': 'URM备份表'}

    id = Column(INTEGER(10), primary_key=True, comment='备份ID')
    model = Column(VARCHAR(255), nullable=False, comment='模型')
    recycle_bin_id = Column(INTEGER(10), nullable=False, comment='回收站ID')
    value = Column(LONGTEXT, comment='数据')
    create_time = Column(INTEGER(10), comment='备份时间')


class XlxUrmRecycleBin(Base):
    __tablename__ = 'xlx_urm_recycle_bin'
    __table_args__ = {'comment': 'Urm回收站表'}

    id = Column(INTEGER(11), primary_key=True)
    uid = Column(INTEGER(11), comment='会员ID')
    rid = Column(INTEGER(11), comment='简历ID')
    photo_img_src = Column(VARCHAR(255), comment='简历照片')
    fullname = Column(VARCHAR(255), comment='姓名')
    is_bind = Column(TINYINT(1), comment='是否绑定微信')
    contact_mobile = Column(CHAR(12), comment='简历联系方式')
    education_cn = Column(VARCHAR(255), comment='学历')
    experience_cn = Column(VARCHAR(255), comment='经验')
    complete_percent = Column(INTEGER(11), comment='完整度')
    high_quality = Column(INTEGER(11), comment='等级')
    delivery_num = Column(INTEGER(11), comment='投递数')
    downloaded = Column(INTEGER(11), comment='被下载数')
    viewed = Column(INTEGER(11), comment='被查看')
    invitation = Column(INTEGER(11), comment='被面邀')
    audit = Column(INTEGER(11), comment='审核状态')
    works = Column(INTEGER(11), comment='简历作品数')
    refreshtime = Column(INTEGER(11), comment='刷新时间')
    last_login_time = Column(INTEGER(11), comment='登录时间')
    reg_time = Column(INTEGER(11), comment='注册时间')
    contact_status = Column(INTEGER(11), comment='联系状态')
    member_mobile = Column(CHAR(12), comment='会员联系方式')
    follow_num = Column(INTEGER(11), comment='跟进次数')
    final_follow = Column(INTEGER(11), comment='最后跟进时间')
    remark = Column(VARCHAR(255), comment='简历备注')
    operate_id = Column(INTEGER(11), comment='操作者ID')
    operate_admin = Column(VARCHAR(255), comment='操作管理员')
    operate_time = Column(INTEGER(11), comment='操作时间')
    status = Column(TINYINT(1), server_default=text("'1'"))
    is_status_weixin = Column(TINYINT(11), server_default=text("'1'"), comment='联系状态微信:1=未联系,2=已联系')
    is_status_phone = Column(TINYINT(11), server_default=text("'1'"), comment='联系状态电话:1=未联系,2=已联系')


class XlxViewJob(Base):
    __tablename__ = 'xlx_view_job'
    __table_args__ = (Index('index_company_uid', 'company_uid'), Index('index_personal_uid', 'personal_uid'))

    id = Column(INTEGER(10), primary_key=True)
    company_uid = Column(INTEGER(10), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)
    jobid = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxViewResume(Base):
    __tablename__ = 'xlx_view_resume'
    __table_args__ = (Index('index_company_uid', 'company_uid'), Index('index_personal_uid', 'personal_uid'))

    id = Column(INTEGER(10), primary_key=True)
    company_uid = Column(INTEGER(10), nullable=False)
    personal_uid = Column(INTEGER(10), nullable=False)
    resume_id = Column(INTEGER(10), nullable=False)
    addtime = Column(INTEGER(10), nullable=False)


class XlxWechatFans(Base):
    __tablename__ = 'xlx_wechat_fans'
    __table_args__ = (Index('openid', 'openid', unique=True),)

    id = Column(INTEGER(10), primary_key=True)
    openid = Column(String(50), nullable=False)
    subscribe_time = Column(INTEGER(10), nullable=False, server_default=text("'0'"), comment='（最后）关注时间')


class XlxWechatKeyword(Base):
    __tablename__ = 'xlx_wechat_keyword'

    id = Column(INTEGER(10), primary_key=True)
    word = Column(String(30), nullable=False)
    return_text = Column(String(255), nullable=False)
    return_img = Column(String(255), nullable=False)
    return_img_mediaid = Column(String(100), nullable=False)
    return_link = Column(String(255), nullable=False)


class XlxWechatMenu(Base):
    __tablename__ = 'xlx_wechat_menu'

    id = Column(INTEGER(10), primary_key=True)
    pid = Column(INTEGER(10), nullable=False, server_default=text("'0'"))
    title = Column(String(30), nullable=False)
    key = Column(String(30), nullable=False)
    type = Column(String(30), nullable=False)
    url = Column(String(255), nullable=False)
    pagepath = Column(String(100), nullable=False)
    sort_id = Column(INTEGER(10), nullable=False, server_default=text("'0'"))


class XlxWechatNotifyRule(Base):
    __tablename__ = 'xlx_wechat_notify_rule'

    id = Column(INTEGER(10), primary_key=True)
    alias = Column(String(30), nullable=False)
    utype = Column(TINYINT(1), nullable=False, comment='会员类型：1|企业，2|求职者，3|管理员，4|服务号群发')
    title = Column(String(30), nullable=False)
    is_open = Column(TINYINT(1), nullable=False)
    tpl_name = Column(String(30), nullable=False)
    tpl_number = Column(String(50), nullable=False)
    tpl_trade = Column(String(30), nullable=False)
    tpl_id = Column(String(50), nullable=False)
    tpl_data = Column(String(200), nullable=False)
    tpl_param = Column(String(100), nullable=False)
    tpl_type = Column(TINYINT(1), nullable=False, server_default=text("'2'"), comment='模板类型：1|旧版，2|新版')


class XlxWechatShare(Base):
    __tablename__ = 'xlx_wechat_share'

    id = Column(INTEGER(10), primary_key=True)
    alias = Column(String(30), nullable=False)
    name = Column(String(30), nullable=False)
    content = Column(String(100), nullable=False)
    img = Column(String(30), nullable=False)
    img_self_cn = Column(String(30), nullable=False)
    explain = Column(String(100), nullable=False)
    params = Column(Text, nullable=False)
